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

How do i execute a change team script?

Asked by 10 years ago

-How do i change the team of everyone in my game server from blue to red -How do i make it so that when the player dies then he changes back to blue team

1 answer

Log in to vote
0
Answered by 10 years ago

You are going to have to set the AutoAssignable for blue to false.

function MoveToBlue()
    for _,Player in pairs(Game.Players:GetPlayers()) do
    --Looping through all players
        Player.TeamColor = BrickColor.new("Bright blue")
            --Change Team color
        Player.CharacterAdded:wait() --Make sure they are alive first
        Player.Character.Humanoid.Died:connect(function()
            --When they die
            Player.TeamColor = BrickColor.new("Bright red")
                    --Change back to red
        end)
    end
end

MoveToBlue()
0
i want them to all change team at a certain point in the game raymandon 0 — 10y
0
Oh sorry thanks it works raymandon 0 — 10y
0
gave me red squigily lines raymandon 0 — 10y
0
Doesnt work raymandon 0 — 10y
0
Updated NotsoPenguin 705 — 10y
Ad

Answer this question