Help with first person script

I have a play button and whenever I click it I make it so that the characters camera goes into first person. However whenever they die they are stuck in first person and cannot move there mouse. How could I possibly fix this issue?

local Teleports = workspace.Teleports:GetChildren()
local button = script.Parent.MainButtons.PlayText
local Players = game:GetService("Players")
local player  = Players.LocalPlayer

local function OnButtonClicked()
	local RandomSpawn = Teleports[math.random(1, #Teleports)]

	game.Workspace.Click:Play()

	local Character = player.Character

	local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")

	HumanoidRootPart.CFrame = CFrame.new(RandomSpawn.Position) + Vector3.new(0,10,0)
	
	script.Parent.Parent.Ammo.Enabled = true
	
	script.Parent.Parent.CH.Enabled = true
	
	script.Parent.Parent.Inventory.Enabled = true

	script.Parent.Parent.MainScreen.Enabled = false
	
	script.Parent.Camera.Disabled = true
	
	script.Parent.FirstPerson.Disabled = true
	
	script.Parent.ClassicCamera.Disabled = false
	
end

button.MouseButton1Click:Connect(OnButtonClicked)

I think it’s because you’re disabling the camera? The code is a bit hard to understand because there’s a lot of variables we can’t see, but I’m pretty sure you can just use a player property for first person instead.

You could make it a frame for it to connect to and then have it say Frame.Visible = false and Camera.CameraType = Enum.CameraType.Custom

add variables the part , the player , Camera and the character

I don’t know if this is a part that the camera is connecting to but if it is then try

wait(3.5)

repeat wait()

Camera.CameraType = Enum.CameraType.Scriptable

until Camera.CameraType == Enum.CameraType.Scriptable

Camera.CFrame = game.Workspace.Part

try turnin off first person mode when plr die :slight_smile: ?

ur guis look great lol