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

Script that Picks a Random Player?

Asked by 10 years ago

I'm Making a Game And i Want it To Pick a Random Person to Be Killer And the Rest To Be a Runner Can You Help Me?

1 answer

Log in to vote
1
Answered by 10 years ago

I'm a beginner at scripting but it may be something like

_G.getRandomPlayer = function()
local pl = game.Players:getPlayers()
return(pl[math.random(1, #pl)])
end

Put that in a script and all scripts in the game can use it like this:

getRandomPlayer().Character:BreakJoints()

would kill a random person. But in your case just use it to change them as killer maybe change their team to killer or give something in backpack Whatever you want the killer to have/do

0
Um Can you Be More Specific I Don't no What this means? I Want the Killer To Change To Killer Team? PixelZombieX 8 — 10y
Ad

Answer this question