|
| 22 Mar 2014 09:57 PM |
for example, i tried:
local player1 = math.random(game.Players:GetChildren())
but it doesn't work. how would i do this? |
|
|
| Report Abuse |
|
|
|
| 22 Mar 2014 09:59 PM |
players = game.Players:GetPlayers()
plr = players[math.random(1,#players)] |
|
|
| Report Abuse |
|
|
tery215
|
  |
| Joined: 19 Aug 2009 |
| Total Posts: 3879 |
|
|
| 22 Mar 2014 09:59 PM |
i think this method is optimal
local player1 = game.Players:GetChildren()[math.random(1, game.Players.NumPlayers)] |
|
|
| Report Abuse |
|
|
|
| 22 Mar 2014 10:15 PM |
plrs = game.Players:GetPlayers()
plr = plrs[math.random(1, #plrs)] print(plr.Name) |
|
|
| Report Abuse |
|
|
|
| 22 Mar 2014 10:17 PM |
"i think this method is optimal
local player1 = game.Players:GetChildren()[math.random(1, game.Players.NumPlayers)]"
Nop. Pointless one.
local player1 = game.Players:GetChildren()[math.random(game.Players.NumPlayers)] |
|
|
| Report Abuse |
|
|
|
| 22 Mar 2014 10:18 PM |
| The one I posted is correct. |
|
|
| Report Abuse |
|
|