Ragdoll script isnt working help

this is the out put

17:40:05.759 GetDecendants is not a valid member of Model “Workspace.noxomos” - Server - RagDoll_Module:9
17:40:05.759 Stack Begin - Studio
17:40:05.760 Script ‘ReplicatedStorage.RagDoll_Module’, Line 9 - function Ragdoll - Studio - RagDoll_Module:9
17:40:05.760 Script ‘ServerScriptService.ToolStun’, Line 68 - Studio - ToolStun:68

script module

--created by noxomos


local Ragdoll = {}

function Ragdoll.Ragdoll(char)
	local humanoid = char:FindFirstChild("Humanoid")
	
	for _, joint in pairs(char:GetDecendants()) do
		
		if joint:IsA("Moter6D") then
			local socket = Instance.new("BallSocketConstraint", joint.Parent)
			
			local a1 = Instance.new("Attachment")
			local a0 = Instance.new("Attachment")
			
			a0.CFrame = joint.C0
			a1.CFrame = joint.C1
			
			a0.Name = "Attch"
			a1.Name = "Attch"
			
			a0.Parent = joint.Part0
			a1.Parent = joint.Part1

			
			local socket = Instance.new("BallSocketConstraint", joint.Parent)

			socket.Attachment0 = a0
			socket.Attachment1 = a1

		
			
			socket.LimitsEnabled = true
			socket.TwistLimitsEnabled = true
			
			socket.TwistUpperAngle = 70
			socket.TwistLowerAngle = 70
			
			joint.Enabled = false
		end
	end
end

function Ragdoll.Stand(char)
	local humanoid = char:FindFirstChild("Humanoid")
	local joints = char:GetDecendants()

	for _, joint in pairs(joints) do

		if joint:IsA("BallSocketConstraint") then
			
			joints:Destroy()
			
		elseif joint:IsA("Attachment") and joint.Name == "Attch" then
			
			joint:Destroy()
			
		elseif joint:IsA("Moter6D") then
			
			joint.Enabled = true

		end
	end
end

return Ragdoll

I recommend using this ragdoll system. It’s really good and useful. Ragdoll Script R15 and R6 [PC, Mobile, Xbox]

But what @NicoleSydor said is more useful

1 Like

The error in this script is just a simple spelling mistake. The word is spelt correctly as “Descendants”, not “Decendants”.

Script
--created by noxomos


local Ragdoll = {}

function Ragdoll.Ragdoll(char)
	local humanoid = char:FindFirstChild("Humanoid")
	
	for _, joint in pairs(char:GetDescendants()) do
		
		if joint:IsA("Moter6D") then
			local socket = Instance.new("BallSocketConstraint", joint.Parent)
			
			local a1 = Instance.new("Attachment")
			local a0 = Instance.new("Attachment")
			
			a0.CFrame = joint.C0
			a1.CFrame = joint.C1
			
			a0.Name = "Attch"
			a1.Name = "Attch"
			
			a0.Parent = joint.Part0
			a1.Parent = joint.Part1

			
			local socket = Instance.new("BallSocketConstraint", joint.Parent)

			socket.Attachment0 = a0
			socket.Attachment1 = a1

		
			
			socket.LimitsEnabled = true
			socket.TwistLimitsEnabled = true
			
			socket.TwistUpperAngle = 70
			socket.TwistLowerAngle = 70
			
			joint.Enabled = false
		end
	end
end

function Ragdoll.Stand(char)
	local humanoid = char:FindFirstChild("Humanoid")
	local joints = char:GetDescendants()

	for _, joint in pairs(joints) do

		if joint:IsA("BallSocketConstraint") then
			
			joints:Destroy()
			
		elseif joint:IsA("Attachment") and joint.Name == "Attch" then
			
			joint:Destroy()
			
		elseif joint:IsA("Moter6D") then
			
			joint.Enabled = true

		end
	end
end

return Ragdoll

I’m sure there are better ragdoll systems out there (which you can search for), but I see you’re creating your own, and I understand if you prefer to be original and able to put your own creations to good use. If you want to use a different ragdoll system, I suggest you check out the last post.

1 Like