Ragdoll script doesn't work

So the script i wrote is supposed to make you ragdoll when you say “/ragdoll”, but it doesnt work:

game.Players.PlayerAdded:Connect(function(plr)
	plr.Chatted:Connect(function(msg)
		if msg == "/ragdoll" then
			local hum = plr.Character:FindFirstChildOfClass("Humanoid")
			hum.BreakJointsOnDeath = false
			hum:ChangeState(Enum.HumanoidStateType.Ragdoll)
			for _,j in pairs(plr.Character:GetDescendants()) do
				if j:IsA("Motor6D") then
					local a0 = Instance.new("Attachment")
					a0.Name = "a0"
					a0.Parent = j.Part0
					a0.CFrame = j.C0
					local a1 = Instance.new("Attachment")
					a1.Name = "a1"
					a0.Parent = j.Part1
					a0.CFrame = j.C1
					local socket = Instance.new("BallSocketConstraint")
					socket.Name = j.Part0.Name.." to "..j.Part1.Name
					socket.Attachment0 = a0
					socket.Attachment1 = a1
					socket.Parent = j.Part0
					j.Part0.CanCollide = true
					j.Part1.CanCollide = true
					j.Enabled = false
				end
			end
		end
	end)
end)

In result, i get this:
image
The output doesn’t say anything.
(upon the humanoid dying it works perfectly)
Please tell me if there is a fix.

4 Likes

Could you check and send the console to me?

2 Likes

i checked the output multiple times, theres nothing

2 Likes

if breakjointsondeath is on, it works, so try disable the normal joints of the character when ragdolling

1 Like

didn’t work, i’ll remind you that it is R6, not R15.

1 Like

just realized I had to not edit the rootjoint and disable requiresneck

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.