Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Accessing a Player's Starting Scripts?

Asked by 8 years ago

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 :)

0
Oh, I forgot to put the properties of the script up: https://gyazo.com/f194a8457f5ea2d8212c1191ca720373 tacktic2010 70 — 8y

1 answer

Log in to vote
1
Answered by 8 years ago

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.

Ad

Answer this question