• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Only want one sound to be playable at once!?

W

WillCampbell21

Guest
Hey guys! I'm currently in the middle of making a soundboard and have made it so that the player cannot repeat the same sound (so the don't spam it) but I don't know how to make it so that if they click on a different sound, the one that is playing stops. Basically only having one sound play at a time.

I posted this question a week or so ago and people did respond but I couldn't quite figure out how to get it done.

Thank you!
 
W

WillCampbell21

Guest
Any idea on how to set up the !global.SFX variable? I've googled it and tried to slot it in here and there but I can't quite figure it out.
 

Electros

Member
That's just a variable being checked in the example - you can just run this function before you play a sound:

Code:
audio_stop_all();
 
Top