Okay so I'm working with a game and currently when the user joins in the game by pressing the join game button it sets there camera mode to firstpersonlock and when they die it sets it to Classic so there mouse can be released and thereforth they can click the button again. However after the first time the player dies it wont work anymore help?
Script (To set camera mode back):
local player = script.Parent.Parent repeat wait() until player.Character ~= nil game.Players.LocalPlayer.Character.Humanoid.Died:connect(function() cam.CameraType = "Watch" script.Parent.Parent.CameraMode = Enum.CameraMode.Classic end)
Try this. The problem is that when the character dies, they get a new humanoid, so then you'll need their humanoid again to attach to the died event.
Make sure to put this into a LocalScript
local player = game.Players.LocalPlayer local cam = game.Workspace.CurrentCamera player.CharacterAdded:connect(function(chr) cam.CameraType = "Whatever It Should Be When They're Alive" cam.CameraMode = Enum.CameraMode.LockFirstPerson chr:WaitForChild("Humanoid").Died:wait() cam.CameraType = "Watch" script.Parent.Parent.CameraMode = Enum.CameraMode.Classic end)