MisterQuestions Posted August 13, 2014 Posted August 13, 2014 Hi, i have a dude and its how to set the volume to 50% or less to play another sounds, and when that sound is finished. stop playing it and set the map music to 100 again, any one could help me?
Et-win Posted August 13, 2014 Posted August 13, 2014 local gMap = exports.mapmanager:getRunningGamemodeMap() local mapRoot = getResourceRootElement(gMap) getElementsByType("sound", mapRoot)
MisterQuestions Posted September 7, 2014 Author Posted September 7, 2014 Mmmm...And how to set the volume to 50% or less?
MisterQuestions Posted September 7, 2014 Author Posted September 7, 2014 so if it will be like this...?? local gMap = exports.mapmanager:getRunningGamemodeMap() local mapRoot = getResourceRootElement(gMap) theSound = getElementsByType("sound", mapRoot) setSoundVolume(theSound, 0.5)
koeno100 Posted September 7, 2014 Posted September 7, 2014 so if it will be like this...?? local gMap = exports.mapmanager:getRunningGamemodeMap() local mapRoot = getResourceRootElement(gMap) theSound = getElementsByType("sound", mapRoot) setSoundVolume(theSound, 0.5) Almost. local gMap = exports.mapmanager:getRunningGamemodeMap() local mapRoot = getResourceRootElement(gMap) theSounds = getElementsByType("sound", mapRoot) for placeNumber,sound in ipairs(theSounds) do setSoundVolume(theSound, 0.5) end
MisterQuestions Posted September 7, 2014 Author Posted September 7, 2014 What does this do? for placeNumber,sound in ipairs(theSounds) do
koeno100 Posted September 7, 2014 Posted September 7, 2014 theSounds is a table filled with all sounds from gMap that code will basically take every single sound in the table and set the volume to 50%
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