local N=script.Parent:WaitForChild("\072\117\109\097\110\111\105\100")N.BreakJointsOnDeath=false N.Died:Connect(function()for N,j in pairs(script.Parent:GetDescendants())do if j:IsA("\077\111\116\111\114\054\068")then local N=Instance.new("\066\097\108\108\083\111\099\107\101\116\067\111\110\115\116\114\097\105\110\116")local C=Instance.new("\065\116\116\097\099\104\109\101\110\116")local f=Instance.new("\065\116\116\097\099\104\109\101\110\116")C.Parent=j.Part0 f.Parent=j.Part1 N.Parent=j.Parent N.Attachment0=C N.Attachment1=f C.CFrame=j.C0 f.CFrame=j.C1 N.LimitsEnabled=true N.TwistLimitsEnabled=true j:Destroy()end end end)

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

humanoid.BreakJointsOnDeath = false

humanoid.Died:Connect(function()
	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)
