Humanoid dying when BallSocketConstraint disabled

So im making a ragdoll script and every time i disable the ball constraints the player dies im not sure how to fix that

humanoid.HealthChanged:Connect(function()
	if humanoid.Health <= 25 then 
		Ragdoll()
	end
end)



humanoid.HealthChanged:Connect(function()
	if humanoid.Health >= 25 then 
		for _,descendant in ipairs(character:GetDescendants()) do
			if descendant:IsA("BallSocketConstraint") then
				descendant.Enabled = false
			end
			
		end
	end
end)

can you tell us what behaviour you would expect by disabling the ballsocketconstraint?

The problem is probably that you are disabling the only constraint that attaches the head to the torso, which kills the player.

I’m guessing once the players health goes above 25 it should unragdoll them; disabling the joints

a ballsocket isn’t used when connecting the torso to the head

my guess is that you replace some motor6d with ball-socket to let the character ragdoll.
maybe share that part of the script as well, so we can see what would be the best way to unragdoll them?