-
What do you want to achieve? Ragdoll system for Rthro morphs
-
What is the issue? Head keeps falling off when ragdolling
-
What solutions have you tried so far? I’ve tried adding another elseif for head and that does seem to fix the head falling off issue however the head keeps shaking like crazy. Im guessing due to missing constraint?
Any and all help is very appreciated as I am still learning. Thanks in advance
c.Humanoid.Died:Connect(function()
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
if string.match(v.Name, "Ankle") then
local ballSocket = replicated.Ankle:Clone()
ballSocket.Parent = v.Parent
ballSocket.Attachment0 = a0
ballSocket.Attachment1 = a1
elseif string.match(v.Name, "Elbow") then
local hinge = replicated.Elbow:Clone()
hinge.Parent = v.Parent
hinge.Attachment0 = a0
hinge.Attachment1 = a1
elseif string.match(v.Name, "Hip") then
local ballSocket = replicated.Hip:Clone()
ballSocket.Parent = v.Parent
ballSocket.Attachment0 = a0
ballSocket.Attachment1 = a1
elseif string.match(v.Name, "Knee") then
local ballSocket = replicated.Knee:Clone()
ballSocket.Parent = v.Parent
ballSocket.Attachment0 = a0
ballSocket.Attachment1 = a1
elseif v.Name == "Neck" then
local ballSocket = replicated.Neck:Clone()
ballSocket.Parent = v.Parent
ballSocket.Attachment0 = a0
ballSocket.Attachment1 = a1
elseif string.match(v.Name, "Shoulder") then
local ballSocket = replicated.Shoulder:Clone()
ballSocket.Parent = v.Parent
ballSocket.Attachment0 = a0
ballSocket.Attachment1 = a1
elseif v.Name == "Waist" then
local ballSocket = replicated.Waist:Clone()
ballSocket.Parent = v.Parent
ballSocket.Attachment0 = a0
ballSocket.Attachment1 = a1
elseif string.match(v.Name, "Wrist") then
local ballSocket = replicated.Wrist:Clone()
ballSocket.Parent = v.Parent
ballSocket.Attachment0 = a0
ballSocket.Attachment1 = a1
end
v:Destroy()