Skip to content

Instantly share code, notes, and snippets.

@qaisjp
Created January 13, 2015 23:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save qaisjp/ab593351aa9d5e9e0337 to your computer and use it in GitHub Desktop.
Save qaisjp/ab593351aa9d5e9e0337 to your computer and use it in GitHub Desktop.
local sounds = {
"hello.mp3",
"2a.mp3",
"a.as.mp3",
"ahe.wav"
}
local currentNumber;
addCommandHandler("startPlaylist", function()
if currentNumber then return end
currentNumber = 1
playSound(sounds[1])
end)
addEventHandler("onClientSoundStopped", resourceRoot, function(reason)
-- Won't check for reason because I don't care... play it no matter what.
currentNumber = currentNumber + 1
if sounds[currentNumber] then
playSound(sounds[currentNumber])
end
end)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment