Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make a Team Generator?

Asked by 10 years ago

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

Log in to vote
0
Answered by
yurhomi10 192
10 years ago

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
0
So what exactly will this do?? NinjoOnline 1146 — 10y
0
I need it to get the map chosen and into the workspace, then pick 1 killer and the rest to runner NinjoOnline 1146 — 10y
0
Basically , it picks a random player. The others are just posted with a 'not it' comment. yurhomi10 192 — 10y
0
how can I get them to teleport them to the spawns in map, and how can I get a random map chosen NinjoOnline 1146 — 10y
View all comments (2 more)
0
Pretty much in order I need the ONE script to do this: NinjoOnline 1146 — 10y
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 NinjoOnline 1146 — 10y
Ad

Answer this question