Why can't I get to the PlayerScripts?

Im trying to make a script that disables/enables rain but i cant get to the rain script because its in
StarterPlayerScripts This is the script that wont work for some reason.

game.Players.PlayerAdded:Connect(function(plr)
    local rainscript = plr.PlayerScripts:WaitForChild("RainScript")
end)

This is the error im getting.

image

For security reasons, PlayerScripts is only accessible by the client.

2 Likes

Yeah, you can’t really access client stuff from the server. To do this you would have to create a remote event that will let the client know that it needs to start/stop raining and let that client script handle it.

1 Like