Why am i receiving an error stating that "PlayerScripts is not a valid member of player"?
Asked by
6 years ago Edited 6 years ago
Hello i'm trying to disable the "ControlScript" in PlayerScripts which is a folder in the player (similar to 'PlayerGui') But whenever i try to access the 'PlayerScripts' folder i receive the error saying the folder is not a valid member of player...
I've tried using ":WaitForChild", "Repeat wait()" and even for loops but all 3 of those ways are not working and i keep getting the same result.
It is very weird and i remember having this problem a while back with the PlayerGui folder but gave up on that project because of that error.
Here is the script as of current (Server Script):
01 | local path = require(game.ServerScriptService.Modules:FindFirstChild( "NoirPhoenix's Pathfinding" )) |
02 | local Target = workspace.Portal:WaitForChild( "Target" ) |
05 | game.ReplicatedStorage.Events.Challenge.OnServerEvent:Connect( function (plr,ePlr) |
09 | plr.PlayerScripts:WaitForChild( "ControlScript" ).Disabled = true |
10 | ePlr.PlayerScripts:WaitForChild( "ControlScript" ).Disabled = true |
15 | path.new(plr.Character,Target) |
16 | path.new(ePlr.Character,Target) |