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.
@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
You should not be asking this question because Roblox randomizes teams by default. No need to ask, really.