I am attempting to make a script that disables a script in the PlayerScripts folder but its coming back with an error I don't know how to fix.
script.Parent.Touched:Connect(function(part)
if part.Parent:FindFirstChild("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(part.Parent)
game.Players[player.Name].PlayerScripts.CameraScript.enabled = false
end
end)
That is the script. And when ever it runs when a player hits it it comes back with.
PlayerScripts is not a valid member of Player "Players.Xenaside"
(Xenaside is my username)
Anyone know how this can be resolved? I've been trying to fix this for a while now.

4 comments
What type of script is in starterplayer normal or local script
It is a local script, since its a camera script
ok I will take a look at it
That doesn't at all look like a local script, considering it's inside a part inside the workspace, where localscripts can't run unless they're inside a character. Use a RE to do some communication.