check if unit is attacked

Level 10
Joined
Jul 2, 2004
Messages
690
how do you make an effective way to check if a unit is attacked by using JASS? sorry for the inconvenience.
 
Level 11
Joined
Jul 20, 2004
Messages
2,760
Well, usually the idea is to create a local trigger, with the event EVENT_UNIT_DAMAGE and for the (Triggering Unit), and as a condition to make it so that only the attacker actually affects the unit. The only thing would be to give a time limit in which the unit can be damaged, because if not, if players abuse the EVENT_UNIT_ATTACKED delay then there will be dozens of leaks causing lag.

~Daelin
 
Level 10
Joined
Jul 2, 2004
Messages
690
ok, now im confused. i use the EVENT_UNIT_DAMAGE to check that a unit is damaged? then what what do i use EVENT_UNIT_ATTACKED for? :oops: (sorry this is actually my first time trying out JASS)
 
Level 10
Joined
Jul 2, 2004
Messages
690
so i add EVENT_UNIT_DAMAGED as a condition right? then do i need to add the other one? (man im feeling stupid right now :cry: )
 
Top