Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Does removing welds also remove the parts they are welding?

Asked by 5 years ago

The following script deletes the welds as well as what they are welding:

script.Parent.Activated:Connect(function()
    for x,y in pairs (script.Parent:GetDescendants()) do
        if y:IsA('ManualWeld') then
            y:Destroy()
        end
    end
end)

I don't know if this is supposed to happen. I am trying to make a script that only deletes the welds. How would I do this?

I have also tried this (got no errors):

script.Parent.Activated:Connect(function()
    for x,y in pairs (script.Parent:GetDescendants()) do
        if y:IsA('ManualWeld') then
            y.Part0 = nil
            y.Part1 = nil
            y:Destroy()
        end
    end
end)

Answer this question