Bean666 Posted June 16, 2016 Share Posted June 16, 2016 making a random sound system eh... why does it keep playing even tho 4 AM(ingame time) is done? local soundtable = { "sound.mp3", "sound2.mp3"} setTimer (function() local hour, minute = getTime ( ) if hour >= 22 or hour <= 4 then sound = playSound( soundtable[ math.random( 1,#soundtable ) ], false ) if isElement(sound) then setSoundVolume(sound, 0.4) else if isElement(sound) then setSoundVolume(sound, 0) end end end end ,10000, 0 ) Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now