can someone help me how I can have a sound continuously playing when pressing keys
function inputStart(obj, gameProcessed, plr) if gameProcessed then return end local equiped = player.Character:FindFirstChild(script.Parent.Name) if obj.KeyCode == Enum.KeyCode.W then if equiped then Up:Play() Left:Stop() Down:Stop() Right:Stop() script.Parent.Sound:FireServer() -- Sound Plays wait(.5) script.Parent.SoundStop:FireServer() -- Sound Stop end elseif obj.KeyCode == Enum.KeyCode.A then if equiped then Left:Play() Up:Play() Down:Stop() Right:Stop() script.Parent.Sound:FireServer() -- same Sound Plays wait(.5) script.Parent.SoundStop:FireServer() -- same Sound Stop -- Code that continues... It's the same thing end
Whenever .5 ends, the sounds just have a seizure when I spam keys. I need to find out how to reset wait() or keep the sound playing when spamming keys
If you go to 'Properties' in the Sound, you have an option called 'Loop'. Enable the loop option to continuously play the sound when enabled.