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

How to make a Team Generator?

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.

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

6 comments

0

So what exactly will this do??

0

I need it to get the map chosen and into the workspace, then pick 1 killer and the rest to runner

0

Basically , it picks a random player. The others are just posted with a 'not it' comment.

0

how can I get them to teleport them to the spawns in map, and how can I get a random map chosen

0

Pretty much in order I need the ONE script to do this:

0

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

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