hi, I've made this script, But I want to delete any extra sound instances. there should be a maximum of 1 Sound instance.
local Clicker = script.Parent
function onClick()
local Music = Instance.new("Sound", game.Workspace)
Music.SoundId = "https://www.roblox.com/asset/?id=229710755"
Music.Looped = false
Music.Archivable = false
wait(0)
Music:Play()
wait(120)
Music:Stop()
if game.Workspace.Sound == true then
game.Workspace.Sound:Remove()
end
end
Clicker.ClickDetector.MouseClick:connect(onClick)
any help will be appreciated.

3 comments
The script works, change line 11 to (if game.Workspace:FindFirstChild("Sound") then)
That didn't work, but thanks for helping
Oh, if there is more than one, I didn't read the whole thing