Just some context: I am using 2013 Roblox to code this. Don't ask why.
In my game, there is a part that makes you fling and turn into a ragdoll. I am using glue instance because as I said I am using 2013 Roblox. There is one problem and that is when I fling and ragdoll sometimes the arm and legs disconnect from the body. Sometimes, the HEAD disconnects. And then the player dies. Is there any way to make it so that the limbs don't disconnect?
Btw, if you don't understand what I mean by "disconnect": Basically, the limbs leaving the body.
Here is my code, I am an amateur coder so sorry if I did something stupid.
local touch = script.Parent
touch.Touched:connect(function(hit)
local character = hit.Parent
local hum = character:FindFirstChild("Humanoid")
local torso = character:WaitForChild("Torso")
local head = character:WaitForChild("Head")
for _, joint in ipairs(torso:GetChildren()) do
if joint:IsA("Motor6D") then
local glue = Instance.new("Glue")
glue.Parent = torso
glue.Part0 = joint.Part0
glue.Part1 = joint.Part1
glue.C0 = joint.C0
glue.C1 = joint.C1
joint:Remove()
end
end
end)