0

# Attempt to index nil with 'CFrame'?

Asked by 1 month ago
Edited 1 month ago

** EDIT: I realized that I typed something wrong. **

I have this error on my Local Script ( Camera Script ) and it says attempt to index nil with 'CFrame'. Now the weird problem with this script is that I have the same function which does the same thing and there aren't any errors on that function.

local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Camera = workspace.CurrentCamera
local cameras = workspace.cameras

local Rep = game:GetService("ReplicatedStorage")
local Rem = Rep.Remotes

function FrontDoorC(obj)
repeat wait()
Camera.CameraType = Enum.CameraType.Scriptable
until Camera.CameraType == Enum.CameraType.Scriptable
Camera.CFrame = obj.CFrame
end
function EndFrontDoorC()
repeat wait()
Camera.CameraType = Enum.CameraType.Custom
until Camera.CameraType == Enum.CameraType.Custom
end

function Scenes(obj)
repeat wait()
Camera.CameraType = Enum.CameraType.Scriptable
until Camera.CameraType == Enum.CameraType.Scriptable
Camera.CFrame = obj.CFrame
end
function End_Scene()
repeat wait()
Camera.CameraType = Enum.CameraType.Custom
until Camera.CameraType == Enum.CameraType.Custom
end

Rem.FrontDoorC.OnClientEvent:Connect(FrontDoorC)
Rem.StopFrontDoorC.OnClientEvent:Connect(EndFrontDoorC)
Rem.Scene.OnClientEvent:Connect(Scenes)
Rem.End_Scene.OnClientEvent:Connect(Scenes)

1
Please show your script that uses :FireClient() thank you T3_MasterGamer 2142 — 1mo
0
Please know that I said ** EDIT: I realized that I typed something wrong. **. Brioche_Noodle 45 — 1mo
0
^ We still need to see the script calling :FireClient() blowup999 659 — 1mo
0
I was getting this problem too on my camera script. I resorted to using an already made camera script. Any luck on fixing yours? KingDomas 153 — 1mo