Folder not a valid member of PlayerScripts

What are you attempting to achieve?

Creating a Custom Character.

I am trying to reference a folder of player values I have stored in the LocalPlayer’s PlayerScripts folder.
These contain PlayerSpeed and Camera Offset values.

What is the issue?

The PlayerValues folder is not a valid member of PlayerScripts.

What solutions have you tried so far?

-Removing the values from the PlayerValues folder making their parent the PlayerScripts Folder.
-Double checked spelling and making sure all objects are in the correct place.

Camera Script

Control Script

It’s been a while since I’ve done some scripting on ROBLOX so perhaps a few things have changed during my absence? I’d appreciate any help this receives :slight_smile:

1 Like

You may want to try and use WaitForChild, sometimes object don’t replicate in time when you want to use them. When you use WaitForChild, you’d only need to wait for the the PlayerValues folder, as Roblox replicates entire children (alongside with their descendants) one at a time

Something like this:

local Player = game:GetService('Players').LocalPlayer

local PlayerScripts = Player:WaitForChild('PlayerScripts')

local PlayerValues = PlayerScripts:WaitForChild('PlayerValues')
local PlayerSpeed = PlayerValues.PlayerSpeed.Value
4 Likes

Solved the issue! Thank you.

1 Like

Thanks for the awesome post! It was very detailed and the screenshots were very helpful!

2 Likes