Fixing camera after GUI trigger

I am having an issue with camera manipulation, seen below in this video: https://streamable.com/7yqmj4

My code for the first client manipulation to send them to the spawn screen

local cam = workspace.CurrentCamera

local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()

local rem = game.ReplicatedStorage.ChangeCam

rem.OnClientEvent:Connect(function()
	char:WaitForChild("HumanoidRootPart").CFrame = workspace.SpawnPad.CFrame + Vector3.new(0,10,0)
	
	cam.CameraType = Enum.CameraType.Scriptable
	
	cam.Focus = CFrame.new(workspace.CamPart.CFrame.LookVector)
	cam.CFrame = workspace.CamPart.CFrame
end)

char:WaitForChild("Humanoid").Died:Connect(function()
	plr.CharacterAdded:Wait()
	
	char:WaitForChild("HumanoidRootPart").CFrame = workspace.SpawnPad.CFrame + Vector3.new(0,10,0)
	
	cam.CameraType = Enum.CameraType.Scriptable

	cam.Focus = CFrame.new(workspace.CamPart.CFrame.LookVector)
	cam.CFrame = workspace.CamPart.CFrame
	
	rem.Parent.ShowUi:FireServer(plr)
end) 

My code for resetting the camera on gui trigger

local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:wait()

game.ReplicatedStorage.ShowUi.OnClientEvent:Connect(function()
	script.Parent.Enabled = true
end)

script.Parent.TextButton.MouseButton1Click:Connect(function()
	
	print(cam.CameraType)
	
	cam.CameraType = "Custom"
	
	char:WaitForChild("HumanoidRootPart").CFrame = workspace.SpawnPad.CFrame + Vector3.new(0,10,0)
	
	print(cam.CameraType)

	script.Parent.Enabled = false
end)

If anyone can help me, that would be great!

Could you try doing CharacterAdded:Connect() instead of .Died and if so, please delete CharacterAdded:Wait()

I did try that. The issue happens when the player clicks deploy after resetting/dying

Hmm, could you look as server and check where the player is on the server?

They are at the black spawn area

Could you change their CFrame to spawn on server please?

What it is supposed to do is teleport a player to the area where they are held in the deploy screen until the camera type is reset to custom

But I can try that for now, lets see if that will do anything