Weld remover not working

Hi, there are many welds named “Snap” which I want to remove but there are so many of them it would take like 10 years to do by hand. So im creating a script for it and it is not working. Can someone help? Here is my current code:

for _,v in pairs(workspace:GetDescendants()) do
	if v.Name == "Snap" and v:IsA("Weld") and v.Parent ~= workspace["JToH Kit v5.4"] and v.Parent ~= workspace["JToH Kit 5.4 (Modified)"] then
		v:Destroy()
	end
end

Try this:

for _,v in pairs(workspace:GetDescendants()) do
	if string.match(v.Name, "Snap") or string.match(v.ClassName, "Weld") or v.Parent ~= workspace["JToH Kit v5.4"] or v.Parent ~= workspace["JToH Kit 5.4 (Modified)"] then
		v:Destroy()
	end
end

Does not work:

1 Like

Is your script inside ServerScriptService?

It is in workspace.

weiusdkjasddas

Make sure its in ServerScriptService, that way it can do its job

Still the same.

Try this?

for _, Welds in pairs(workspace:GetDescendants()) do
if string.match(Welds.ClassName, "Weld") and Welds:IsA("Weld") then

Welds:Destroy()
end

end


I really don’t know why this isn’t working.

Im not sure, im testing it and it works for me

I did this:

for _, Welds in pairs(workspace:GetDescendants()) do
	if string.match(Welds.ClassName, "Weld") then
		Welds:Destroy()
	end
end

Works in workspace and ServerScriptService

Still does not work. Try testing it and renaming your welds in workspace to something else like “Foo” and if it still works try putting it into folders. Cause thats what my workspace looks like.

still works,

ClassName is different than Name i hope you know that

I know but I thought it has to do something with it lol. Also I just did

for _, Welds in pairs(workspace:GetDescendants()) do
	if Welds:IsA("Weld") then
		Welds:Destroy()
	end
end

even with the most simplest form it still does not work.

1 Like

Not sure

Character Limit

Snap is a different class from Weld, try changing it to:

for _, Welds in pairs(workspace:GetDescendants()) do
	if Welds:IsA("Weld") or Welds:IsA("Snap") then
		Welds:Destroy()
	end
end
2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.