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

4 comments

1

Please show your script that uses :FireClient() thank you

0

Please know that I said ** EDIT: I realized that I typed something wrong. **.

0

^ We still need to see the script calling :FireClient()

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?