So my camera script works completely fine untill i die, the camera stays in the same place and doesnt move eg
local plr = game.Players.LocalPlayer
local mouse = plr:GetMouse()
repeat wait() until plr.Character
local char = plr.Character
local cam = game.Workspace.CurrentCamera
local zoom = 100
cam.FieldOfView = 15
cam.CameraType = Enum.CameraType.Scriptable
mouse.WheelForward:connect(function()
if zoom > 70 then
zoom = zoom - 2
else
zoom = 80
end
end)
mouse.WheelBackward:connect(function()
if zoom < 100 then
zoom = zoom + 2
else
zoom = 100
end
end)
while true do
game["Run Service"].RenderStepped:wait()
if char then
if char:FindFirstChild("Head") then
cam.CoordinateFrame = CFrame.new(Vector3.new(char.Head.Position.X+zoom,char.Head.Position.Y+zoom,char.Head.Position.Z+zoom),char.Head.Position)
end
end
end

2 comments
it hasn't worked i put it before the true loop and it just zoomed in
figured out what the problem was and updated the answer with the updated code