Try this one
local isPlaying = {}
local isPlaying1 = 0
local qPressed = 0
local mySong = 0
function jukeboxt_init(e)
LoadGlobalSound ( "audiobank\\music\\medievalpack_music\\a beautiful place.wav", 1 )
LoadGlobalSound ( "audiobank\\music\\medievalpack_music\\a sea of tales.wav", 2 )
LoadGlobalSound ( "audiobank\\music\\medievalpack_music\\magic of enchantment.wav", 3 )
LoadGlobalSound ( "audiobank\\music\\medievalpack_music\\on thin grounds.wav", 4 )
LoadGlobalSound ( "audiobank\\music\\medievalpack_music\\land at war.wav", 5 )
end
function jukeboxt_main(e)
Prompt(isPlaying1 .." - " ..mySong)
if mySong == 0 then
if isPlaying1 == 0 then
PlayGlobalSound ( 1 )
end
mySong = 1
end
isPlaying1 = GetGlobalSoundPlaying ( 1 )
if mySong == 1 then
if isPlaying1 == 0 then
PlayGlobalSound ( 2 )
end
mySong = 2
end
isPlaying1 = GetGlobalSoundPlaying ( 2 )
if mySong == 2 then
if isPlaying1 == 0 then
PlayGlobalSound ( 3 )
end
mySong = 3
end
isPlaying1 = GetGlobalSoundPlaying ( 3 )
if mySong == 3 then
if isPlaying1 == 0 then
PlayGlobalSound ( 4 )
end
mySong = 4
end
isPlaying1 = GetGlobalSoundPlaying ( 4 )
if mySong == 4 then
if isPlaying1 == 0 then
PlayGlobalSound ( 5 )
end
mySong = 0
end
isPlaying1 = GetGlobalSoundPlaying ( 5 )
end
Just attach the script to a dynamic entity, make it "AlwaysActive = yes".
You most likely has to replace paths with your own in the script - I'm using 5 sounds there.
It works for me.
NJote: Please try it as is before do any chage.
hth
Laptop: Lenovo - Intel(R) Celeron(R) CPU 1005M @ 1.90GHz
OS: Windows 10 (64) - Ram: 4 gb - Hd: 283 gb - Video card: Intel(R) HD Graphics
cpu mark: 10396.6
2d graphics mark: 947.9
3d graphics mark: 8310.9
memory mark 2584.8
Disk mark: 1146.3
Passmark rating: 3662.4