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

Script that Picks a Random Player?

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

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

1 comment

0

Um Can you Be More Specific I Don't no What this means? I Want the Killer To Change To Killer Team?

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