the-rpg-thing/src/audio.lua
2021-12-04 18:43:51 -06:00

23 lines
485 B
Lua

function playSoundFX(audio)
if audio == nil then do return end end
audio:stop()
audio:play()
end
local currentlyplaying = nil
function playAudio(audio)
if audio == nil then do return end end
if currentlyplaying ~= nil then
currentlyplaying:stop()
end
currentlyplaying = audio
currentlyplaying:play()
currentlyplaying:setLooping(true)
end
function stopAudio()
if currentlyplaying ~= nil then
currentlyplaying:stop()
end
end