Broken Radgoll Script (Server Sided)

Hey, any idea why this doesn’t work?
https://gyazo.com/58b2e3d8cbaf2746d9fdd279f49d36ff

  ---function for radgoll---
--<<<<<<<<<<<<<>>>>>>>>>>>>>-
local function radgoll(player)
	local character = player.Character
	for i,v in pairs(character:GetChildren()) do
		if v:IsA("Motor6D") then
			local a0, a1 = Instance.new("Attachment"), Instance.new("Attachment")
			a0.CFrame = v.C0
			a1.CFrame = v.C1
			a0.Parent = v.Part0
			a1.Parent = v.Part1
			
			local b = Instance.new("BallSocketConstraint")
			b.Attachment0 = a0
			b.Attachment1 = a1
			b.Parent = v.Part0
			
			v.Enabled = false
		end
	end
	character.HumanoidRootPart.CanCollide = false
end

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		local humanoid = char:WaitForChild("Humanoid")
		wait(5)
		radgoll(plr)
	end)
end)

You have to check when the player dies, so you would have to utilize the Humanoid.Died event like this:

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		local humanoid = char:WaitForChild("Humanoid")
		humanoid.Died:Connect(function()
             ragdoll(plr)
        end)
	end)
end)
1 Like

I’m trying to radgoll them even if they don’t die, aka radgoll them alive and un-radgoll them alive.

Here, referring more to this: Best way to create an R15 Toggled Radgoll Script (Preferably BallSocket)

Its because the motor6Ds are still connected. So the default roblox joints are holding it all in place.

1 Like

And how can I fix that in my script?

Simply disabled them. Then enable them when you no longer want to ragdoll.

1 Like

I already do that,

v.Enabled = false

In theory it should be working then. So long as roblox doesnt treat them like a joint and continue as normal.

But clearly something going on. I’ve tried disabling and connecting it to attachments and it seems to work.

1 Like

I found the problem, I used GetChildren instead of GetDescendants.