I have six teams and the max players is six. how would I make a script that spreads the players out one team each?
Hi Nickelz,
local teams = { BrickColor.new("Black"); BrickColor.new("Really red"); BrickColor.new("Really blue"); BrickColor.new("Pastel Blue"); BrickColor.new("Daisy orange"); BrickColor.new("Shamrock"); } local players = game:GetService("Players"); for _, player in next, players:GetPlayers() do local index = math.random(#teams) -- Random number from 1 to Amount of Teams. local team = teams[index]; -- The team color chosen on random. player.TeamColor = team; -- Sets player's team color to random team color teams.remove(teams, index); -- Removes the team color so it doesn't get repeated end
Thanks,
Best regards,
~~ KingLoneCat