• 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.

[Trigger] A player leaves the game

Status
Not open for further replies.
Level 3
Joined
Oct 8, 2011
Messages
27
I can't make this TRIGGER to work.
When a player leaves it should destroy his buildings and unites.

  • Player 1 Red Leaves
    • Events
      • Player - Player 1 (Red) leaves the game
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units owned by Player 1 (Red)) and do (Unit - Kill (Triggering unit))
      • Game - Display to (All players) for 5.00 seconds the text: Player Red had left...
What is wrong ?
 
Level 12
Joined
Oct 16, 2010
Messages
680
it should be

  • Unit Group - Pick every unit in (Units owned by Player 1 (Red)) and do (Unit - Kill (Picked unit))
triggering unit is a response to a unit event

for unit picks - use Picked unit

EDIT: and you should also use this before Unit Group - ...blabla

  • Custom script: set bj_wantDestroyGroup = true
 
Last edited:
Level 17
Joined
Feb 11, 2011
Messages
1,860
What Lender said.

Your complete trigger would look like this:

  • Trigger
    • Events
      • Player - Player 1 (Red) leaves the game
      • Player - Player 2 (Blue) leaves the game
      • Player - Player 3 (Teal) leaves the game
      • Player - Player 4 (Purple) leaves the game
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units owned by (Triggering player)) and do (Actions)
        • Loop - Actions
          • Unit - Kill (Picked unit)
      • Game - Display to (All players) the text: ((Name of (Triggering player)) + has left the game.)
Notice how I have made this run if Player 1 - 4 leaves. You can add more players in the event section. The text will display the name of the leaving player.
 
Status
Not open for further replies.
Top