I’d like to fix my ragdolling script, which is intended to be able to use even if the player is not dead. Currently, when ragdolled and alive, the player starts floating up.
https://gyazo.com/cbe9e301998493c92d914c3e6e2b326f
Here’s my code:
local Char = script.Parent
local Hum = Char:WaitForChild("Humanoid")
local Root = Char:WaitForChild("HumanoidRootPart")
local function Ragdoll()
for i, v in pairs(Char: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.Parent
v:Destroy()
end
end
Root.CanCollide = false
end
wait(10)
Ragdoll()
If anyone knows what else I need to add or remove, please let me know. Thanks!