Trigger should be working..

Xebarsis

New Member
Reaction score
7
I have a simple trigger that makes it so that if a player leaves, he is removed from the scoreboard along with all of his units. Unfortunately half the time the units aren't removed, and I'm not sure why. Here's the trigger:

Code:
Player 10 Light Blue
    Events
        Player - Player 10 (Light Blue) leaves the game
    Conditions
    Actions
        Game - Display to (All players) the text: ((Name of (Triggering player)) +  has left the game.)
        Leaderboard - Remove Player 10 (Light Blue) from (Last created leaderboard)
        Unit Group - Remove all units from (Units owned by Player 10 (Light Blue))

I have one for every player.
 

saw792

Is known to say things. That is all.
Reaction score
280
The units won't be removed because you aren't removing the units, just removing the units from the unit group. This causes odd behaviour when they are no longer in the group of the owning player though. Instead use a Pick Every Unit In Unit Group action.

NB: your triggers leak a unit group. Set the group to a variable, and then remove it after the actions.
 

freakincage

New Member
Reaction score
1
Code:
Unit Group - Pick every unit in (Units owned by Player 10 (Light Blue)) and do (Actions)
    Loop - Actions
        Unit - Remove (Picked unit) from the game
 

Xebarsis

New Member
Reaction score
7
Alright, thanks guys; I fixed it all up. This was one of my first triggers so I didn't have them combined into one, it was broken, and it caused leaks. Still got a lot to learn though!
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top