RagdollModule.SetupRagdoll=function(G)for G,t in pairs(G:GetDescendants())do if t:IsA("\077\111\116\111\114\054\068")then local G=Instance.new("\065\116\116\097\099\104\109\101\110\116")local q=Instance.new("\065\116\116\097\099\104\109\101\110\116")G.Parent=t.Part0 q.Parent=t.Part1 G.CFrame=t.C0 q.CFrame=t.C1 local U=Instance.new("\066\097\108\108\083\111\099\107\101\116\067\111\110\115\116\114\097\105\110\116")U.Parent=t.Parent U.Enabled=false U.Attachment0=G U.Attachment1=q end end end RagdollModule.Ragdoll=function(G)for t,q in pairs(G:GetDescendants())do if q:IsA("\077\111\116\111\114\054\068")then local G=q G:Destroy()elseif q:IsA("\066\097\108\108\083\111\099\107\101\116\067\111\110\115\116\114\097\105\110\116")then local G=q G.Enabled=true elseif q.Name=="\072\101\097\100"then if q:IsA("\066\097\115\101\080\097\114\116")then local t=q local U=G:WaitForChild("\072\117\109\097\110\111\105\100\082\111\111\116\080\097\114\116")t.CanCollide=true local O=Instance.new("\087\101\108\100\067\111\110\115\116\114\097\105\110\116")O.Parent=t O.Part0=t O.Part1=U end end end end
-- / Functions / --
RagdollModule.SetupRagdoll = function(Character)
	for _, Joint in pairs(Character:GetDescendants()) do
		if Joint:IsA("Motor6D") then
			local A0 = Instance.new("Attachment")
			local A1 = Instance.new("Attachment")

			A0.Parent = Joint.Part0
			A1.Parent = Joint.Part1

			A0.CFrame = Joint.C0
			A1.CFrame = Joint.C1

			local BallSocketConstraint = Instance.new("BallSocketConstraint")
			BallSocketConstraint.Parent = Joint.Parent
			BallSocketConstraint.Enabled = false
			BallSocketConstraint.Attachment0 = A0
			BallSocketConstraint.Attachment1 = A1
		end
	end
end

RagdollModule.Ragdoll = function(Character)
	for _, CharacterObject in pairs(Character:GetDescendants()) do
		if CharacterObject:IsA("Motor6D") then
			local Joint = CharacterObject

			Joint:Destroy()
		elseif CharacterObject:IsA("BallSocketConstraint") then
			local BallSocketConstraint = CharacterObject

			BallSocketConstraint.Enabled = true
		elseif CharacterObject.Name == "Head" then
			if CharacterObject:IsA("BasePart") then
				local Head = CharacterObject
				local HRP = Character:WaitForChild("HumanoidRootPart")

				Head.CanCollide = true

				local HeadWeld = Instance.new("WeldConstraint")
				HeadWeld.Parent = Head
				HeadWeld.Part0 = Head
				HeadWeld.Part1 = HRP
			end
		end
	end
end
