Stop Timer if Unit dies.

romanandre

New Member
Reaction score
2
How can I stop a timer if a unit dies, I have tried by making another periodic timer but seens to not work very well, thanks for helping.
If you need exemple of what I'm trying to do , let me know!
 

romanandre

New Member
Reaction score
2
Can you be more clear, the StopTimer function , it just stop a timer, but how should I make a function to stop timers if a unit die without using TriggerRegisterAnyUnitEvent?
 

Dirac

22710180
Reaction score
147
You can't. luorax suggests you to use unit indexing systems because they assign custom values to units as they enter the game.
However at the end of the timer you can check if the unit is alive and skip all actions if it aint, but i recommend you not to do it as the other method is way cleaner.

This system would make detecting unit death easier if many units have it's own timer.
http://www.hiveworkshop.com/forums/jass-functions-413/snippet-registerplayerunitevent-203338/

Otherwise i suggest you to take the array away from your timer variable and have a trigger that only records specific unit events
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top