|
| 18 Feb 2017 05:23 PM |
Everytime I try to choose a random player it fails.
local randomplayer = math.random(1 #game.Players:GetPlayers()) local newplayer = game.Players:GetPlayers[randomplayer] print(newplayer.Name) |
|
|
| Report Abuse |
|
|
|
| 18 Feb 2017 05:27 PM |
| nope, ROBLOX decided to go into ### math library and make math.random() error every time. it's not because you're forgetting a comma after ### first argument/you don't need ### first argument because it's optional |
|
|
| Report Abuse |
|
|
|
| 18 Feb 2017 05:27 PM |
local randomplayer = math.random(1,#game.Players:GetPlayers()) local newplayer = game.Players:GetPlayers()[randomplayer] print(newplayer.Name)
|
|
|
| Report Abuse |
|
|
|
| 18 Feb 2017 05:28 PM |
why the argument if it's optional? I guess it might look better to some people but I'm kinda a minimalist when it comes to those things
|
|
|
| Report Abuse |
|
|
|
| 18 Feb 2017 05:29 PM |
| Even if I forget the brackets in GetPlayers() it still wouldn't have worked |
|
|
| Report Abuse |
|
|
|
| 18 Feb 2017 05:30 PM |
I didn't address that at all because right after seeing your error on the first line I stopped reading the code
|
|
|
| Report Abuse |
|
|
|
| 18 Feb 2017 05:30 PM |
| I know that too but I tried it once and it didnt work. |
|
|
| Report Abuse |
|
|
|
| 18 Feb 2017 05:31 PM |
and they're called parentheses
|
|
|
| Report Abuse |
|
|
|
| 18 Feb 2017 05:31 PM |
| just putting it how he has it. I don't normally use ### first arg if it's not needed. he is also calling for ### table twice instead of just making it a variable but oh well. He wants it like this:( |
|
|
| Report Abuse |
|
|
|
| 18 Feb 2017 05:32 PM |
Ik that too Unsub
I figured it out when another guy on my thread posted the script and added the brackets to GetPlayers() cuz I forgot it. |
|
|
| Report Abuse |
|
|
|
| 18 Feb 2017 05:33 PM |
Why do you guys type so fast?
I cant keep up cuz im on mobile. |
|
|
| Report Abuse |
|
|
| |
|