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

CameraScript is not a valid member of PlayerScripts?

So I am trying to define CameraScript inside of the player, but this error(from the title) keeps coming, any ideas?

local Came = game.Players.LocalPlayer.PlayerScripts.CameraScript

2 comments

0

Local script? Also check spelling...

0

It is, spelling is all correct

1 answer

###This is because PlayerScripts is one of those classes that need a WaitForChild, as they do not load instantly.

local plr = game:GetService("Players").LocalPlayer
local plrScripts = plr:WaitForChild("PlayerScripts")
local camerascript = plrScripts:FindFirstChild("CameraScript")

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