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

Can anyone tell me a script about team selection please?

Hello I hope you have a Good day....So I am making a game on roblox that contain four team one player for each team like one player in red team and one player in blue team,,,etc....I don't want the players to choose their team i want them to be in a random team selection.....if anyone can help me i would appreciate that I've been looking everywhere for help....I hope you guys would help me....Thank you

1 answer

✓ Accepted answer
game.Players.PlayerAdded:Connect(function(plr)
	local teams = game:GetService("Teams"):GetChildren()
	plr.Team = teams[math.random(1,#teams)]
end)

3 comments

0

Thank you mattscy for replying to me question :D .......im still a newbie in game creations.....how do i make four teams red,blue,Green and yellow...if you have more information that would be great

0

Thank you so much for your help I made four teams with ur help.....i hope you have an amazing day....thank you again

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