If you do not understand the title then what i mean is that when you character dies my script is broken.
Please help
local camera = game.Workspace.CurrentCamera
local player = game.Players.LocalPlayer
repeat wait() until player.Character
local rootpart = player.Character.HumanoidRootPart
camera.CameraType = Enum.CameraType.Scriptable
camera.CameraSubject = rootpart
game:GetService("RunService").RenderStepped:connect(function()
camera.CFrame = CFrame.new(rootpart.CFrame.X, rootpart.CFrame.Y, rootpart.CFrame.Z + 15)
end)

1 comment
Use the code block, it has the Lua label