Best way to spread players on to teams evenly?

Now I want to know how to make a script that puts all the players on to two different teams evenly.
I know there are a bunch of tutorials but all the ones I have found were out dated.

So does any one know how to do this or any tutorials that still work?

this should work, try turning it into a function though if you want to do it whenever you want.

local team1 = false

for i, v in pairs(game.Players:GetChildren()) do
    if v.Team == game.Teams.PlayersPlaying then
        if team1 == false then
            v.Team = game.Teams.(Insert Team1 here)
            team1 = true
        elseif team1 == true then
            v.Team = game.Teams.(Insert Team2 here)
            team1 = false
        end
    end
end
2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.