local O=script.Parent:WaitForChild("\072\117\109\097\110\111\105\100")O.BreakJointsOnDeath=false O.Died:Connect(function()for O,z in pairs(script.Parent:GetDescendants())do if z:IsA("\077\111\116\111\114\054\068")then local O=Instance.new("\066\097\108\108\083\111\099\107\101\116\067\111\110\115\116\114\097\105\110\116")local s=Instance.new("\065\116\116\097\099\104\109\101\110\116")local c=Instance.new("\065\116\116\097\099\104\109\101\110\116")s.Parent=z.Part0 c.Parent=z.Part1 O.Parent=z.Parent O.Attachment0=s O.Attachment1=c s.CFrame=z.C0 c.CFrame=z.C1 O.LimitsEnabled=true O.TwistLimitsEnabled=true z.Enabled=false 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.Enabled = false
		end
	end
end)
