I’m trying to change the camera when you step on a part using a remote event
I’m getting the error “attempt to index nil with CFrame”
my script
cameraeventS.OnClientEvent:Connect(function(plr, cam)
camera.CameraType = Enum.CameraType.Scriptable
camera.CFrame = cam.CFrame
return cam
end)
local script ^
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
wait(0.25)
cameraevent:FireClient(plr, house1cam1)
plr.Character.HumanoidRootPart.CFrame = entrance.CFrame*CFrame.new(0,5,0)
end
end)
server script ^