• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Event triggers more than once

Status
Not open for further replies.
Level 2
Joined
Oct 22, 2010
Messages
19
Well i made a trigger that is suposed to teleport a hero back to base when a player types a massage containing : -b . It works pretty well , but the problem is if he types the command again then the trigger begins again while still processing the 1st one. So if i type -b more times then once it will teleport me more than once and it results in a special effect bug. I hope you guys get this ty in advance ... :D
 
Level 2
Joined
Oct 22, 2010
Messages
19
OK but will it still finish the one that already started ? Because the full trigger lasts for about 6 secs
 
Level 3
Joined
Sep 30, 2012
Messages
31
OK but will it still finish the one that already started ? Because the full trigger lasts for about 6 secs

Yeah it will, but note that this won't work for multiple units trying to use this trigger (since when the second unit uses it the trigger will be off). If you only have 1 hero then it's fine.

If you want to make it work for more than 1 hero do this:
Create an array of booleans.
When a hero uses -b, set the boolean corresponding to that player to true.
When he finishes teleporting, set it to false.
If the boolean for a player is true, then don't do anything when the player uses -b.
 
Level 2
Joined
Oct 22, 2010
Messages
19
I already made different triggers for different players , so if i turn the trigger of after the start , then it will still finish it's job and block any other attempts of using it again, before i turn it on again?
 
Status
Not open for further replies.
Top