Heyo! Today I am making a R to ragdoll thing but I can't seem to make the unragdoll work and the ragdoll floats up instead of having gravity.
Sorry for the dogey title, had to add a question mark.
Here is the death script:
local function ragdoll(c) for _, v in pairs(c:GetDescendants()) 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:Destroy() for e, v in pairs(c:GetChildren()) do if v:IsA("Part") then v.CanCollide = true end end end end c.Head.CanCollide = true c.HumanoidRootPart.CanCollide = false end game.Players.PlayerAdded:Connect(function(p) p.CharacterAdded:Connect(function(ch) ch.Humanoid.BreakJointsOnDeath = false ch.Humanoid.Died:Connect(function() ragdoll(ch) end) end) end)
And I am trying to convert it. Here is the currently "converted" script
local function ragdoll(c) for _, v in pairs(c:GetDescendants()) 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:Destroy() for e, v in pairs(c:GetChildren()) do if v:IsA("Part") then v.CanCollide = true end end end end c.Head.CanCollide = true c.HumanoidRootPart.CanCollide = false end local function unragdoll(c) for _, v in pairs(c:GetDescendants()) do if v:IsA("BallSocketConstraint") or v:IsA("Attachment") then v:Destroy() end end end game.Players.PlayerAdded:Connect(function(p) p.CharacterAdded:Connect(function(ch) wait(4) ragdoll(ch) wait(4) unragdoll(ch) end) end)
Any help on making the ragdoll not float and a unragdoll? The current unragdoll just kills the player. Taking off the Attachments/BSocketConstraints from a body part causes it to just fall off.
NOTE: I think it keeps loop-ragdolling some odd reason.
For making the ragdoll not float, I'd turn on PlatformStand for the humanoid of the ragdoll. As for actually restoring the normal state, I would store the joints in some kind of folder and restore them when you see fit.