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:

1script.Parent.Activated:Connect(function()
2    for x,y in pairs (script.Parent:GetDescendants()) do
3        if y:IsA('ManualWeld') then
4            y:Destroy()
5        end
6    end
7end)

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):

1script.Parent.Activated:Connect(function()
2    for x,y in pairs (script.Parent:GetDescendants()) do
3        if y:IsA('ManualWeld') then
4            y.Part0 = nil
5            y.Part1 = nil
6            y:Destroy()
7        end
8    end
9end)

Answer this question