Camera won't return to normal after button is pressed

So, I made a physical main menu (those ones that use SurfaceGUIs instead), but here’s the thing, I can’t figure out how to fix the camera when the player chooses a team!

First iteration of script:

local Players = game:GetService("Players")
local Player = Players.LocalPlayer or Players.PlayerAdded:Wait()
local Character = Player.Character or Player.CharacterAdded:Wait()
local Camera = workspace.CurrentCamera
local MenuCamera = workspace:WaitForChild("MainMenuCamera")
local event = game:GetService("ReplicatedStorage"):WaitForChild("Events"):WaitForChild("TeamChoice")
local rs = game:GetService("RunService")
local loaded = false

local function resetCameraSubject()
	if workspace.CurrentCamera and Player.Character then
		local humanoid = Player.Character:FindFirstChildOfClass("Humanoid")
		if humanoid then
			Camera.CameraType = Enum.CameraType.Custom
			workspace.CurrentCamera.CameraSubject = humanoid
		end
	end
end

event.OnClientEvent:Connect(function()
	loaded = true
end)

rs.RenderStepped:Connect(function()
	if loaded == false then
		Camera.CameraType = Enum.CameraType.Scriptable
		Camera.CFrame = MenuCamera.CFrame
	end
	if Character then
		if Player.CharacterRemoving then
			if loaded == true then
				return
			end
		end
	end
	task.wait(1)
end)

Second Iteration:

local Players = game:GetService("Players")
local Player = Players.LocalPlayer or Players.PlayerAdded:Wait()
local Character = Player.Character or Player.CharacterAdded:Wait()
local Camera = workspace.CurrentCamera
local MenuCamera = workspace:WaitForChild("MainMenuCamera")
local event = game:GetService("ReplicatedStorage"):WaitForChild("Events"):WaitForChild("TeamChoice")
local rs = game:GetService("RunService")

local buttons = Player:WaitForChild("PlayerGui"):WaitForChild("MainMenu"):WaitForChild("Menus"):WaitForChild("Teams"):GetDescendants()

local function resetCameraSubject()
	if workspace.CurrentCamera and Player.Character then
		local humanoid = Player.Character:FindFirstChildOfClass("Humanoid")
		if humanoid then
			Camera.CameraType = Enum.CameraType.Custom
			workspace.CurrentCamera.CameraSubject = humanoid
		end
	end
end

local loaded = false

rs.RenderStepped:Connect(function()
	if loaded == false then
		Camera.CameraType = Enum.CameraType.Scriptable
		Camera.CFrame = MenuCamera.CFrame
	elseif loaded == true then
		resetCameraSubject()
		return
	end
end)

for _, button in buttons do
	if button:IsA("TextButton") then
		button.MouseButton1Click:Connect(function()
			loaded = true
			resetCameraSubject()
		end)
	end
end

None of these work!

Second Iteration - Server side > client

local event = game:GetService("ReplicatedStorage"):WaitForChild("Events"):WaitForChild("TeamChoice")

event.OnServerEvent:Connect(function(player, team)
	player.Team = team
	player:LoadCharacter()
	task.wait(0.1)
	event:FireClient(player, team)
end)

Tried changing it around a few times, no effect.

It works but the camera returns to the menu when the player resets. I’m trying to do things differenlty but it doesn’t work!

I was unbelievably dumb.

The script was in the starterpack meaning everytime the player reset, the script would too reset.