Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Accessing a Player's Starting Scripts?

So I am trying to access a local script in the Player's starting scripts called cam, this is the code I have in my GUI's localscript: zoom = script.Parent.Parent.Parent.PlayerScripts.cam

It is giving me this beautiful error: cam is not a valid member of PlayerScripts

This is what my current Explorer looks like in that area. https://gyazo.com/d1fad2c66fa220fbf51e519de8cb2d18

If anyone could help that would be lovely :)

1 comment

0

Oh, I forgot to put the properties of the script up: https://gyazo.com/f194a8457f5ea2d8212c1191ca720373

1 answer

✓ Accepted answer

Try doing something of this nature how about using the :findFirstChild() or :WaitForChild() method because it thinks you're addressing the property sometimes.... So do something like this:

local cam = script.Parent.Parent.Parent.PlayerScripts:WaitForChild("cam") -- I prefer :WaitForChild() method because it is less laggy and more efficient.

Thanks for reading the answer! I hope I helped.

This discussion is preserved as it was. New answers, comments, and votes are closed.