• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] Player Leaves the game

Status
Not open for further replies.
Level 12
Joined
Mar 30, 2013
Messages
664
Hi!
TD releated]

When im playing online and a players leave the game and he got for an example 5 towers remaining in the map. And when he have leaved the Towers stands there and keep attacking like it does normaly. So my question is that if some one knows how to remove the tower(s) when the player have leaved?
 
Something along the lines of:
  • Leave Game
    • Events
      • Player - Player 1 (Red) leaves the game
      • Player - Player 2 (Blue) leaves the game
      • ... continue adding events for other players ...
    • 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 - Remove (Picked unit)
If you only want to remove certain units, then you would select "Units owned by (Triggering Player) matching <some condition>". The bj_wantDestroyGroup line is just to prevent a leak from the group created by "Units owned by (Triggering player)".
 
Level 12
Joined
Mar 30, 2013
Messages
664
Ok thank you! It worked fine tested it in bnet, tok some time before a player leaved =P
But a question more. Do you know how to turn of a trigger when the player leaves?
Because i got spawn that is spawning units and if the players leavs it will keep spawning. Got any triggers tips to turn it off when player(s) leaves?
 
Status
Not open for further replies.
Top