Remove Duplicates from a Model or Workspace

Hello, I have been working on this script for the last 15 minutes. I wanted to test and see if I could make a script which deletes duplicated parts from a Model or even Workspace and I made something which I am pretty happy to release and allow others to use this in their place.

Tutorial:

  1. Download this script. (This if for editing purposes.)

  2. Edit the main Variables at the top. local model is the model in which you want to check for duplicates and local waitTime is the time it takes to check each part. I recommend using the current wait time as it works pretty well, but if you would like to make it faster or slower at removing duplicates you can!

  3. When you are happy with your setup go ahead and copy the script into your command bar in studio and run the script. The script will print when it’s finished in the output.

  4. Sit back and let the script do it’s work. This can take some time depending on the map size. I tested with 6k parts and took around 15 Minutes.

Hope this script helps you guys out!!

Download the script here and follow the instructions listed above.

7 Likes

I don’t think this thread belongs here, it should be in #development-support:requests-for-code-feedback. Even so, you’re not asking anything so not sure how we can help you.

Addtionally, its better if you post the code here since its not even that long (just over 100 lines). We shouldn’t be entitled to get this model to help you.

The first thing I’ve spotted is that you’re only checking for Parts, UnionOperations and MeshParts.
This doesn’t include WedgeParts.

if child:IsA("Part") or child:IsA("MeshPart") or child:IsA("UnionOperation") then

You should use the class BasePart and exclude Terrain out.

Ah right, yeah I wasn’t sure where to post it. I’ll update the script now forgot about wedge parts!

Since this seems like a #learning-resources thread. You’ll need to contact a Lead Contributor to give you permission to put this into the relevant place.

This doesn’t work well at all. All it did was delete random parts in my game… I couldn’t even press CTRL+Z to revert the changes that it made so I had to go change my game’s version history.