Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to make gun fire sound not stack if I fire it non-stop?

This script makes a gun fire sound play when I shoot.But the problem is, the sound stacks up and makes a horrible noise. I tried to add a wait(1) before stopping the sound and playing again but it didn't work.

local sound = script.Parent.Handle.Sound
if sound.IsPlaying then
	wait(1)
	sound:Stop()
	sound:Play()
   else
	sound:Play()
end

3 comments

0

Maybe make the sound play as the gun shoots and before the next bullet appears you just stop the sound. That is of course if your gun has any kind of delay between shots.

0

I'll try that.

0

That still didn't work.

1 answer

local sound = script.Parent.Handle.Sound
if sound.IsPlaying = true() then
	wait(1)
	sound:Stop()
	wait(0.5)
	sound:Play()
else
	sound:Play()

Try this.

1 comment

0

Didn't work.

This discussion is preserved as it was. New answers, comments, and votes are closed.