|
| 01 Jun 2014 10:25 PM |
I'm making an Infected game like the one on COD, and I was wondering how to make a script where it randomly selects someone to carry out an event? Kinda like the murder mystery games where they select one person to be the murderer
|
|
|
| Report Abuse |
|
|
| 01 Jun 2014 10:36 PM |
local players = game.Players:GetPlayers() local randomPlayer = players[math.random(#players)]
You can then refer to the randomPlayer all you want throughout the scope, until the scope with the random player resets, or if it's at the top of the script, and the script re-runs. After that it will just pick a new player. |
|
|
| Report Abuse |
|