Jump to content

sound


Bean666

Recommended Posts

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...