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

How to not have all the player in the same team ?

I want to know if there a way to equal

local Teams = game:GetService("Teams")
local T_Name = {
    [1] = "Blue Fighter",
    [2] = "Red Fighter"
}

for _,player in pairs(game.Players:GetPlayers()) do
    player.Team = Teams:FindFirstChild(T_Name[math.random(1, #T_Name)])
end

1 answer

Check for children (people in that team). If there are people there, check the other teams and see which one has the least amount of people in it. Then put the output into a variable and team them that variable. Theoretically this should work but since I'm bad at lua (rlua anyway) I don't know how to do that.

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