I'm a Beginner Developer here and I want to know how I can randomly put players inside teams for my game. My Teams Are: Enforcers, Bombers, and Wittnesses. I will love it if anybody sends me answers.
COMMUNITY QUESTION
How Do I Make A Team Randomizer?
2 answers
@SinisterSinRobloxian Teams are random already with Spawns but if that's not what u mean you can make all of the spawn locations variables then make a script randomly pick them. Which depending on how many Spawn Locations you have I'm going to guess 3 from your listed ones.
It would look something like this
function getRandomSpawn()
local number = math.random(3)
local suit = math.random(3)
local spawn = ""
if number >= 1 and number <= 3 then spawn = number + 1
if suit == 1 then spawn = spawn .. "Enforcers"
elseif suit == 2 then spawn = spawn .. "Bombers"
elseif suit == 3 then spawn = spawn .. "Whittnesses"
else card = "?" end
spawn = spawn .. " of "
else spawn = spawn .. "?" end
return spawn
end
I'm really not familar with math.random so if this doesn't work then sorry but need anymore info use http://wiki.roblox.com/index.php/Random_numbers
1 comment
0
Thank you for the great advice @Delsgamingchannel
You should not be asking this question because Roblox randomizes teams by default. No need to ask, really.
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
It is already random
Make sure you check out the rules before you make a game like this. For what you're doing you can try out the random function http://wiki.roblox.com/index.php?title=Random and team changing http://wiki.roblox.com/index.php?title=API:Class/Player/Team