I forgot an exact way of doing this, but there was a post that had said something about finding duplicated items in the same space.
Getting some ideas from this post here also:
You could make a bool to see if the item is infact a duplicated item in a pcall function. It’ll go through the part and see if the part matches some of the properties as the other part.
Something like this:
local cloned = pcall(function()
while not cloned do
if object2.Name == object.Name then
if object2.CFrame == object.CFrame then
if object2.Size == object.Size then
if object2.Material = object.Material then
-- A LOT OF MORE CODE HERE BUT THAT MAKES YOUR SCRIPT MESSY
else
cloned = false
else
cloned = false
else
cloned = false
end
end
end
end)
Like that note that I just put within the function says, this would indeed be messy if it was done like that. So, I was thinking to still do the pcall function, but instead have it read the properties itself. Making a table of the possible properties of that part, or type of part. Afterwards, if all of the properties match clone would be set to true and therefore if it’s true it’ll Destroy that part.
Which, now that I’m saying it, I think I should make a plugin/module for getting the properties of parts.