Ragdoll problem

You guys I’ve been trying to make the player get up and disable the ragdoll but the player always die

for i,v in pairs(Kick:GetDescendants()) do
					if v:IsA("Motor6D")  then
						v.Enabled = true
					end
					if v:IsA("BallSocketConstraint") then
						v:Destroy()
						
					end
					if v:IsA("Attachment") and v.Name == "A" then
						v:Destroy()
					end
				end
				Kick.Parent:FindFirstChild("Humanoid"):ChangeState(Enum.HumanoidStateType.GettingUp)
				wait(2)
				CanDamage = true
			end
Kick.Parent:FindFirstChild("Humanoid"):ChangeState(Enum.HumanoidStateType.Physics)
				Character:WaitForChild("HumanoidRootPart"):WaitForChild("kick3"):Play()
				Kick.Parent:FindFirstChild("Humanoid"):TakeDamage(10)
				local Cf =CFrame.new(0,3,20)
				local m6d
				local sc 
				for index,joint in pairs(Kick.Parent:GetDescendants()) do
					if joint:IsA("Motor6D") then
						local socket = Instance.new("BallSocketConstraint")
						sc = socket
						m6d = joint
						local a1 = Instance.new("Attachment")
						a1.Name = "A"
						local a2 = Instance.new("Attachment")
					a2.Name = "A"
						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.Enabled = false


					end

				end

Thanks for any help

1 Like

Just never replace the motor6d which connects the HumanoidRootPart and the Torso.

1 Like

It didn’t work but the head now disconnects from the torso

1 Like

Not sure what is causing the head to get disconnected from the torso, but that is the issue at hand.

1 Like

I think i should change the way i make the player ragdoll

1 Like