|
| 08 Aug 2017 04:38 PM |
| I've done :WaitForChild("PlayerScripts") but it doesn't seem to work. I don't understand why it is giving me this error since PlayerScripts is a valid member of the player. |
|
|
| Report Abuse |
|
|
|
| 08 Aug 2017 04:42 PM |
game.Players.PlayerAdded:connect(function(player) local scripts = player:WaitForChild("PlayerScripts") end)
not sure if you're going for something like this but it seems to work in studio |
|
|
| Report Abuse |
|
|
|
| 08 Aug 2017 04:47 PM |
| Thanks for the suggestion, but yet again I get an Infinite yield possible on 'Players.Player2:WaitForChild("PlayerScripts")' |
|
|
| Report Abuse |
|
|
|
| 08 Aug 2017 04:49 PM |
game.Players.PlayerAdded:connect(function(player) local scripts if not player.PlayerScripts then scripts = player:WaitForChild("PlayerScripts") else scripts = player.PlayerScripts end end) |
|
|
| Report Abuse |
|
|
|
| 08 Aug 2017 04:49 PM |
| playerscripts is only accessible with local scripts |
|
|
| Report Abuse |
|
|
|
| 08 Aug 2017 04:51 PM |
whoa i'm stupid. 1)
didnt realize that @AggressiveCatch
2)
player:FindFirstChild("PlayerScripts"), not player.PlayerScripts. |
|
|
| Report Abuse |
|
|
Casualist
|
  |
| Joined: 26 Jun 2014 |
| Total Posts: 4443 |
|
|
| 08 Aug 2017 04:53 PM |
^^ Also, windrises, you have to use FindFirstChild to check for the existence of children
If PlayerScripts is not a child of player, then your conditional:
"if not player.PlayerScripts then"
will error. |
|
|
| Report Abuse |
|
|
Casualist
|
  |
| Joined: 26 Jun 2014 |
| Total Posts: 4443 |
|
| |
|
|
| 08 Aug 2017 05:01 PM |
| Thanks, also nice name you got there @Casualist |
|
|
| Report Abuse |
|
|