Hello, so i’m making a game that has a local script in startergui that basically gives you a view of sometthing in the main menu, it worked before and i didn’t change anything in the script and now it randomly says:
“Unable to assign property CFrame. CoordinateFrame expected, got nil”
here’s the script:
local player = game.Players.LocalPlayer
local char = player.Character
local cc = workspace.CurrentCamera
local pc = game.Workspace:FindFirstChild("PlayCamera")
local dmc = game.Workspace:FindFirstChild("DMCamera")
local pb = script.Parent.MenuGui.PlayButton
local dmb = script.Parent.MenuGui.SettingsButton
wait(.00000001)
cc.CameraType = Enum.CameraType.Scriptable
cc.CFrame = p
local function playEntered()
cc.CFrame = pc.CFrame
end
pb.MouseEnter:Connect(playEntered)
local function dmEntered()
cc.CFrame = dmc.CFrame
end
dmb.MouseEnter:Connect(dmEntered)
Definitely fix the variable name. Also, change all the FindFirstChild() function calls to WaitForChild(), because you need those items for the script to run.