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

How do I delete 2 (or more) accidentally cloned parts in the same position?

Asked by 3 years ago

So long ago, multiple parts in my game were cloned ontop of each other (like Ctrl + D), So I need a command line script that deletes multiple parts in the same position.

I have used one from the DevForum and it did not work. Mostly when I try, it deletes every single part in workspace.

0
Why don't you try to not clone them on top of each other instead- OwOShiba 78 — 3y
0
just check if they have the same x,z position and just delete them ChristianTRPOC 64 — 3y
0
If u click and hold and drag ur mouse a grey square will apear, everything inside the square will get selected. Also if u click shift while selecting u can select multiple items. 0hiivs 0 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago
for index, value in ipairs(game.Workspace:GetChildren())
    if value:IsA("Part") then

        if value.Position == Vector3.new(0,0,0) then -- You can change it to where the parts            are located
            value:Destroy()
        end
        wait()
    end
end
Ad

Answer this question