Hi there. I've been messing around with making a custom dead, and I want to make the cameratype "Scriptable" (So that it doesn't move) and make it "custom" back again when you respawn and make the camerasubject the humanoid back. I tried lots of codes,like this one, which is the actual one, but it simply freezes studio and forces an exit.
local Players = game:GetService("Players")
local Playername = game.Players.LocalPlayer
local plr = game.Players.LocalPlayer
local hum = game:GetService("Players").LocalPlayer.Character
script.Parent.Humanoid.Died:connect(function()
game.Workspace.Camera.CameraType = "Scriptable"
end)
while true do
local chr = plr.Character or plr.CharacterAdded:wait()
game.Workspace.Camera.CameraType = "Custom"
game.Workspace.Camera.CameraSubject = hum.Humanoid
end
I'm starting to think in suicide. Just help please!

1 comment
Try and attach the camera to the torso.