Ragdoll script is killing the humanoids

Okay so, I’m enabling and disabling motor6ds and ballsocketconstraints for ragdolls. This kills the humanoid and I have no idea why. My script:
And I have already put constraints when the character is added.

for _,v in pairs(victim:GetDescendants()) do
	if v:IsA'Motor6D' then
		v.Enabled = false
	end
	if v:IsA'BallSocketConstraint' then
		v.Enabled = true
	end
end
--HOW TO FIX?
1 Like

It’s easier to just set the humanoid’s state to ragdoll.

Local H =
Game.Players.LocalPlayer.Character.Humanoid
H:ChangeState(enum.HumanoidStatetype.Ragdoll)
H:SetStateEnabled(enum.HumanoidStatetype.GettingUp, false)

– sorry I forgot how to use the lua code block

1 Like

This is happening because you’re disabling all Motor6Ds in the character. All Humanoids will die if the Neck joint is either disabled or removed. Resolve this by simply turning off RequiresNeck.

@PhAnToMjose4605 That doesn’t do what you think it does. Check HumanoidStateType for more information. Ragdoll describes a physics state caused by a character being hit by a fast moving object and thus falling over. The Humanoid will get up eventually.

4 Likes

Thanks man. I’ll mark it as solution and @PhAnToMjose4605, your code was messing up my test zombies.

1 Like

Hmm… I am pretty sure I used this in my game and it works fine but yeah I had some issues will definitely look into it.

Also we are setting ‘getting up’ to false to prevent the character from getting up after some time.