I am making a recreation of deathrun, and I need help with the team generator, where it picks a random map from the lighting, then picks a random player to be killer and everyone else to be runner.
✓ ANSWER ACCEPTED
How to make a Team Generator?
1 answer
✓ Accepted answer
its really basic, once you have your random player, you can get the others.
players = game.Players:GetChildren() -- gets current players
randomp = players[math.random(#players)] -- picks random player
print(randomp.Name .. " is it") -- tells us who the random player is
--stuff for it player or random
for i,v in pairs(players) do -- iterate the player table
if v.Name ~= randomp.Name then -- whoever isn't 'it', will tell us who isn't
print(v.Name .. " is not it") -- tells us who
--stuff if not it
end
end
This discussion is preserved as it was. New answers, comments, and votes are closed.

6 comments
So what exactly will this do??
I need it to get the map chosen and into the workspace, then pick 1 killer and the rest to runner
Basically , it picks a random player. The others are just posted with a 'not it' comment.
how can I get them to teleport them to the spawns in map, and how can I get a random map chosen
Pretty much in order I need the ONE script to do this:
A random map to be chosen from the lighting, then a random player is chosen as killer. then all the people are tped to their right spawns. Pretty much if you have played deathrun 2 then youll see how the game flows