• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

check if unit is attacked

Status
Not open for further replies.
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: )
 
Status
Not open for further replies.
Top