#Having a problem with my code

1 messages · Page 1 of 1 (latest)

left wind
#

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)
neat vigil
#

why are you using 2013 roblox

left wind
neat vigil
#

doesn't seem very complicated. the question is very straight-forward. why are you using old outdated software?

left wind
neat vigil
#

...suuuuuuuuuuure

left wind
#

o alright then

#

thanks

neat vigil
#

looks like you have nothing to define break force, so force to break is 0

#

also you're destroying motors which is not a good idea as destroying the neck one will kill

#

configure humanoid etc

#

honestly if you're starting out you should really use latest studio and whatnot