Save the camera CFrame/position after the player dies, then after the player respawns, set the Cameratype to āScriptableā and set the Camera CFrame to the saved one.
Would look like:
local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:wait()
char.Humanoid.Died:Connect(function()
--camera stuff here
end)
In Local pos = Camera.Position.
Camera is underlined in red.
and in game.Workspace.CurrentCamera.CameraType = Enum.CameraType(āScriptableā)
Scriptable is also underlined in red. How do i fix that?
local camera = workspace.CurrentCamera
local plr = game.Players.LocalPlayer
local char = script.Parent
char.Humanoid.Died:Connect(function()
local pos = camera.CFrame --camera CFrame
camera.CameraType = Enum.CameraType.Scriptable
camera.CFrame = pos
task.wait(game.Players.RespawnTime) --wait
camera.CameraType = Enum.CameraType.Custom
end)
if not script.Parent:IsA("Model") then
warn('place in startercharacterscripts')
end