How to delete all Values (and parts) with the same name?

I’ve been working on redesigning a map I was given a while ago. While I was redesigning the game I noticed a lot of useless things and one of those things are useless “values” in almost every part.

Example: image

If anyone could give me a script that would remove every value with the same name would really help me out.

5 Likes

You could run in the command bar:

for i, v in ipairs(workspace:GetDescendants()) do
    if v.Name == "yournamehere" then
        v:Destroy()
    end
end
5 Likes

Or you could use the search bar in explorer without having to run code

That way it’s not that efficient. The reason the command bar exists its to make this kind of stuff easier.

3 Likes

I didn’t realize that until now

either way they should check if it’s a value because anything could be named Value but a different class

you could add :IsA() to the if statement

for i, v in ipairs(workspace:GetDescendants()) do
    if v.Name == "Value" do
        v:Destroy()
    end
end

Type this in the command bad as mentioned by @Ty_Scripts. I believe that’s the only way except manually removing the value.

Much appreciated, you saved me a lot of time here.

1 Like

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