How can I make it so that the ragdoll doesn't kill the player?

So I have a script that ragdolls the player when they are falling, but the problem is, because they destroy every motor6d in the player’s body, it kills the player. I’ve tried NOT destroying motor6d’s, but it looks nothing like a ragdoll. I’ve also tried setting the health to math.huge but that also doesn’t work. How can I accomplish this goal?

Code (LocalScript in StarterCharacterScripts):

-- Variables
local character = script.Parent 
local humanoid = character:WaitForChild("Humanoid")

humanoid.FreeFalling:Connect(function()
	task.wait(0.5)
	humanoid.WalkSpeed = 0
	for index,joint in pairs(script.Parent:GetDescendants()) do
		if joint:IsA("Motor6D") then
			local socket = Instance.new("BallSocketConstraint")
			local a1 = Instance.new("Attachment")
			local a2 = Instance.new("Attachment")
			a1.Parent = joint.Part0
			a2.Parent = joint.Part1
			socket.Parent = joint.Parent
			socket.Attachment0 = a1
			socket.Attachment1 = a2
			a1.CFrame = joint.C0
			a2.CFrame = joint.C1
			socket.LimitsEnabled = true
			socket.TwistLimitsEnabled = true
			joint:Destroy()
		end
	end
end)

turn off RequiresNeck in the humanoid, it might work
Also it would be a good idea to just disable the motor6D instead of deleting it if u plan on unragdolling the player

1 Like

turning off requires neck didn’t work however if you just disable it temporarily, it works just fine and doesn’t kill you, thanks!

1 Like