Jump to content
Sign in to follow this  
Cougar_DK

setDamage and Eventhandler

Recommended Posts

I tried last night to use the eventHandler for "killed" and setDamage to revive the person that just was killed. But it didn't work out that way. The object killed stayed killed.

So is there a way to revive at killed object using a eventHandler?

I'm at work right now and don't have the script right here but I'm pretty sure it was something like this:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">{ _nilPoint = _x addEventHandler[ "killed",{ (_this select 0) setDamage 0.5 ]; }forEach thislist;

(Found the code snippet from here: http://www.flashpoint1985.com/cgi-bin....handler)

Share this post


Link to post
Share on other sites

Hmmmm, I wanted to use the above for some kind of "Medic script". I.e. get a lot more wounds instead of outright kills, giving the medic class something to do in a mission.

But the lack of responses tells me thats not the way to do it or ?

Share this post


Link to post
Share on other sites

This is the way to do it... but it doesn't work in specific conditions according to a post I read on ofpec before it went down.

If respawns are on for players once an event handler "killed" or a isAlive check is performed the setDamage 0 will no longer re-animate/revive the unit.

Sadly, the poster said the only solution is to delete and replace the unit.

When it comes back up do a search on http://www.ofpec.com/

Share this post


Link to post
Share on other sites

Thanx shiner. To bad it dosn't work. It just seems as the right way to do it.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×