hello!
I have here 3 music tracks and i want one of them to start playing randomly. I have coded the first run and it works, however, i want this cycle to keep repeating, that is, i want the function to keep repeating as soon as the first song ends
here is what i have by far:
local bgmusic1 = audio.loadStream( “OctoBlues.wav” )
local bgmusic2 = audio.loadStream( “WotM.wav” )
local bgmusic3 = audio.loadStream( “DistrictFour.wav” )
local musicReference
local bgmusicChannel
musicReference = math.random(0, 2)
if ( musicReference == 0 ) then bgmusicChannel = audio.play( bgmusic1) end
if ( musicReference == 1 ) then bgmusicChannel = audio.play( bgmusic2) end
if ( musicReference == 2 ) then bgmusicChannel = audio.play( bgmusic3) end