Ragdoll:SetPlayerDefault(true)local function M(M,B)if gameStageHandler.currentStage.characterAdded then gameStageHandler.currentStage:characterAdded(M,B)end local A=B:WaitForChild("\072\117\109\097\110\111\105\100")A:SetStateEnabled(Enum.HumanoidStateType.Climbing,false)if not M:HasAppearanceLoaded()then M.CharacterAppearanceLoaded:Wait()end for M,B in pairs(B:GetChildren())do if B:IsA("\065\099\099\101\115\115\111\114\121")then if B.Handle:FindFirstChild("\076\101\102\116\071\114\105\112\065\116\116\097\099\104\109\101\110\116")or B.Handle:FindFirstChild("\082\105\103\104\116\071\114\105\112\065\116\116\097\099\104\109\101\110\116")then B:Destroy()end end end end local function B(B)B.CharacterAdded:Connect(function(A)M(B,A)end)if gameStageHandler.currentStage.playerAdded then gameStageHandler.currentStage:playerAdded(B)end end local function A(M)if gameStageHandler.currentStage.playerRemoving then gameStageHandler.currentStage:playerRemoving(M)end end
--[[
	Player management
]]

Ragdoll:SetPlayerDefault(true)

local function characterAdded(player, character)
	if gameStageHandler.currentStage.characterAdded then
		gameStageHandler.currentStage:characterAdded(player, character)
	end

	local humanoid = character:WaitForChild("Humanoid")
	humanoid:SetStateEnabled(Enum.HumanoidStateType.Climbing, false)

	-- Wait for the avatar to be fully configured
	if not player:HasAppearanceLoaded() then
		player.CharacterAppearanceLoaded:Wait()
	end

	-- Remove accessories that are held in the hand
	for _, instance in pairs(character:GetChildren()) do
		if instance:IsA("Accessory") then
			if
				instance.Handle:FindFirstChild("LeftGripAttachment")
				or instance.Handle:FindFirstChild("RightGripAttachment")
			then
				instance:Destroy()
			end
		end
	end
end

local function playerAdded(player)
	player.CharacterAdded:Connect(function(character)
		characterAdded(player, character)
	end)

	if gameStageHandler.currentStage.playerAdded then
		gameStageHandler.currentStage:playerAdded(player)
	end
end

local function playerRemoving(player)
	if gameStageHandler.currentStage.playerRemoving then
		gameStageHandler.currentStage:playerRemoving(player)
	end
end
