So how would I go about picking 6 Random players every time a new round begins and to put the rest of the players in the other team?
Thank you for your help in advance :)
Create a table containing all the players using GetChildren()
. Then, choose a random player by indexing a random player from that table. Don't forget to remove the chosen players from the table, otherwise they can be chosen twice :
local Players = game.Players:GetChildren() for i = 1, 6 do --Choose six players ChosenPlayerIndex = math.random(#Players) --Chose a random player index Players[ChosenPlayer].TeamColor = BrickColor.new("Bright blue") --Move the chosen player to the blue team table.remove(Players, ChosenPlayerIndex) --Removes the player from the list so he can't be chosen again end
(This script is supposed to be placed inside either game.Workspace or game.ServerScriptService, in a normal script)