Xebarsis
New Member
- Reaction score
- 7
I have a trigger that picks a random player and kills all of their units. Later another trigger respawns them, however sometimes it ends up choosing a player that has left the game.
I'm not sure how to make my trigger not only pick a random player and kill their units, but also not pick someone who has left. Here's my trigger:
I'm not sure how to make my trigger not only pick a random player and kill their units, but also not pick someone who has left. Here's my trigger:
Code:
The Imploder
Events
Unit - A unit Uses an item
Conditions
(Item-type of (Item being manipulated)) Equal to The Imploder
Actions
Set UnluckyPlayer = (Random player from (All enemies of (Owner of (Hero manipulating item))))
Game - Display to (All players) the text: (PlayerColors[(Player number of (Owner of (Triggering unit)))] + (((Name of (Owner of (Triggering unit))) + |R has used, "The Imploder" on ) + (PlayerColors[(Player number of UnluckyPlayer)] + ((Name of UnluckyPlayer) + ,|R INSTANT KILL!))))
Unit Group - Pick every unit in (Units owned by UnluckyPlayer) and do (Actions)
Loop - Actions
Unit - Explode (Picked unit)
Sound - Play HeroAlchemistPissed3 <gen>