Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can you get your game to know when there's no more players on a team left?

Asked by 7 years ago

For example, if a person was on the blue team and they died, which changed them to the red team, what script would allow the game to recognize that there are no more players on the blue team and then execute commands.

Here's what I've tried

player.Character.Humanoid.Died:connect(function()
    player.TeamColor = BrickColor.new("Earth green")
    if #game.Teams.TeamA:GetPlayers() < 1 then
        -- run code for what happens when it reaches 0
    end 
end)
0
you could use #game.Teams.TeamA:GetPlayers() == 0; to test, you may put some sort of debug function such as 'print(args)' davness 376 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago

You can let it know by just creating an Death Script and an LeaveSCriot . Watch Alvinblox on YouTube , he made a complete sword fight with everything. I think on episode 4 or 5 or 6 he made both scripts. Very small but useful! :) glad to help. And I can't write it for you cuz I'm not on Pc right now ^^

Ad

Answer this question