players = game.Players:GetChildren() for i,v in pairs(players) do print(v.Name .. " is on red team") v.TeamColor = BrickColor.new("Bright red") end for i,v in pairs(players) do print(v.Name .. " is on blue team") v.TeamColor = BrickColor.new("Bright blue") end
How can I get this to just pick 2 random teams
To make players go on to two random teams you would need to do :
players = game.Players:GetChildren() teams = {"Bright red","Bright blue"} -- Defines the team colors, you can add more for i,v in pairs(players) do -- Loops through the players v.TeamColor = BrickColor.new(teams[math.random(1,#teams)]) -- Picks one of the brick colors out of the teams table end
If you have any questions, concerns or just need some help with this PM me on ROBLOX!