Is there any way to play the same sound very quickly without it cutting off without using PlayOnRemove?

I am making a machine gun that shoots very rapidly, but I ran into a problem. The gun sound cuts off as soon as the next sound plays because the rate of fire is actually fast than the actual sound. It doesn’t sound good. Is there any way to avoid this without having to clone the sound and removing it/playing it?

-- this works and avoids cutting off the sound, but not what i'm looking for
function fire()
        s = FireSound:Clone()
        s.Parent = Handle
        s.PlayOnRemove = true
        s:Destroy()
end

-- If the rate of fire is faster than the sound length, then the sound will cutoff mid-play.
function fire()
        FireSound:Play()
end

Clone the sound:

function fire()
    local cl = FireSound:Clone()
    cl.Parent = FireSound.Parent
    cl:Play() 
    game:GetService([[Debris]]):AddItem(cl, cl.TimeLength)
end

Apologies for the weird formatting. I’m on my phone.

4 Likes

Thank you both , wish I could accept both answers. Is there a speed advantage for cloning the sound?

I don’t know, but I kind of doubt it. Whatever the difference is, positive or negative, it should be negligible.

1 Like