Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do i execute a change team script?

-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

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()

5 comments

0

i want them to all change team at a certain point in the game

0

Oh sorry thanks it works

0

gave me red squigily lines

0

Doesnt work

0

Updated

This discussion is preserved as it was. New answers, comments, and votes are closed.