I would like the script to automatically detect duplicated sounds not by name, but by SoundId and copy them to a specific folder
I just don’t want to manually delete the duplicated sounds in the folder afterwards
here is the script:
print("creating folder...")
local folder = Instance.new("Folder")
folder.Parent = workspace
folder.Name = "AmbientSoundsDoors"
print("start")
repeat wait(0.05)
if workspace.Terrain:FindFirstChild("Attachment") then
for i,v in pairs(workspace.Terrain.Attachment:GetChildren()) do
if v:IsA("Sound") then
local sound = v:Clone()
sound.Parent = workspace.AmbientSoundsDoors
print("founded sound")
v:Destroy()
sound:Stop()
sound.TimePosition = 0
if sound.SoundId == v.SoundId then
print("founded dublicated sound")
sound:Destroy()
end
end
end
end
until false