Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --BasePart Duplicate Remover by Usering
- local Existing = {}
- local Duplicates = 0
- function scan(place)
- for _,v in pairs(place:GetChildren()) do
- if v:IsA("BasePart") then
- local Hash = v.Name:len() * ((v.Position.X * v.Position.Y * v.Position.Z) / (v.Size.X * v.Size.Y * v.Size.Z))
- if Existing[Hash] then
- print("Found duplicate:",v:GetFullName())
- Duplicates = Duplicates + 1
- v:Destroy()
- else
- Existing[Hash] = v
- end
- end
- scan(v)
- end
- end
- function recur(paths)
- for _,place in pairs(paths) do
- scan(place)
- end
- end
- print("--[[Beginning Duplicate Search...]]--")
- recur({workspace,game.ServerStorage})
- print("Search finished with",Duplicates,"duplicates found and removed.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement