Hello, is there a way that i can delete all parts with the same name (in a model)?
✓ ANSWER ACCEPTED
How can I delete all instances with the same name?
1 answer
✓ Accepted answer
Hello,
You have to use a for loop.
local Parts = game.Workspace:WaitForChild("Model"):GetChildren()
for _, v in pairs(Parts) do
if v.Name == "Delete" then
v:Destroy()
end
end
Parts is a table with everything in the Model. The for loop will go through every element in the table checking if its name is "Delete". If yes, then it will destroy the part.
This discussion is preserved as it was. New answers, comments, and votes are closed.
