Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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.

3 comments

0

Why don't you try to not clone them on top of each other instead-

0

just check if they have the same x,z position and just delete them

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.

1 answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.