FSXTim Posted May 22, 2012 Posted May 22, 2012 Hello, the script doesn't set the volume of the running songs to '0', what's wrong? addEventHandler ( "playTheSound2", root, function () local sounds = getElementsByType ( "sound" ) setSoundVolume ( sounds, 0 ) song = playSound ( "music/party.mp3", false ) setSoundVolume ( song, 2 ) end ) I hope you can help me. Greets
myonlake Posted May 22, 2012 Posted May 22, 2012 addEventHandler("playTheSound2", root, function() for i,v in ipairs(getElementsByType("sound")) do setSoundVolume(v, 0.0) end song = playSound("music/party.mp3", false) setSoundVolume(song, 1.0) end )
Kenix Posted May 22, 2012 Posted May 22, 2012 (edited) getElementsByType - return table with elements. In your case it's sounds elements. Edited May 22, 2012 by Guest
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