Jump to content
  • 0

How to make the player die when a monster dies


Manapro

Question

so I'm making a map where when a monster dies, the player also dies from let's say, a presumed heart attack, I only just want the player's health to reach 0;


I tried to do that with the following code:

#include "zcommon.acs"

script 1 OPEN
{
    Thing_Damage(20,5,0);
}

it doesn't really do anything, but i set the player's tag as 20, and added the placeholder value of 5 in terms of damage, the 0 was a thing i forgot to remove from the," uh
"zdoom wiki" cool coding skills section of my brain.

Thanks in advance for any comment!
 

Share this post


Link to post

2 answers to this question

Recommended Posts

  • 0

I think this could work, if you set this as actor's special(80) in the editor. 

 

script 1 (void)
{

    SetActivatorToTarget(0);
    SetActorProperty(0, APROP_Health, 0);
}

 

Edit: just realized this'll only work if player kills the monster. If the monster can die by some other means, you probably need to assign the player a TID.

script 1 ENTER
{

    Thing_ChangeTID(0, somenumber);

}

 

script 2 (void)
{
    SetActorProperty(somenumber, APROP_Health, 0);
}

Edited by Rifleman

Share this post


Link to post
  • 0
17 minutes ago, Rifleman said:

script 1 ENTER
{

    Thing_ChangeTID(0, somenumber);

}

 

script 2 (void)
{
    SetActorProperty(somenumber, APROP_Health, 0);
}

bro,,,,,,,,, u cured cancer man,,
 

But seriously man, thanks for solving this problem, I appreciate it.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...