• 🏆 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!

[Trigger] count the number of times an unit attacked?

Status
Not open for further replies.
Level 18
Joined
Aug 23, 2008
Messages
2,319
I believe he wants to count the amount of times the unit took damage. Don't you need a damage detecting system for that instead of 'Unit is attacked'? Since I believe that 'Unit is attacked' only activated once, and will only activate again when the attacking unit stops attacking or attacks again.
 
Level 18
Joined
Aug 23, 2008
Messages
2,319
I never worked with a damage detecting system. But if I'm correct, there's a tutorial about it on THW. It's made to detect how much damage is done to a unit, but it can also be used to check if a unit is damaged at all. If you use that, you simply add an integer variable 'AttackTimes = AttackTimes + 1' to the trigger, so it you will count the amount of times a unit has taken damage, which you can use for whatever you want to use it for.
 
Status
Not open for further replies.
Top