Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- int {0 = music, 1 = sound, 2 = voice}
- -- execute from an object with execute script: PlusMinus_Vol(int, false|true) [checks if volume less|more than 0%|100% else volume = volume -|+ 10%]
- -- play_sound | play_speech variables will do whatever is assigned to the actions when you call them with startAction(play_sound|speech)
- -- examples ...
- -- music minus: PlusMinus_Vol(0, false) | music plus: PlusMinus_Vol(0, true)
- -- sound minus: PlusMinus_Vol(1, false) | sound plus: PlusMinus_Vol(1, true)
- -- voice minus: PlusMinus_Vol(2, false) | voice plus: PlusMinus_Vol(2, true)
- -- local play_sound = getObject("Scenes[insert_scene_name_here].SceneActions[insert_action_name_here]")
- function PlusMinus_Vol(val, cond)
- -- globals
- local check_vol = getVolume(val) -- gets current volume level for int specified!
- local play_sound = getObject('Scenes[Options_Menu].SceneActions[play_sound]') -- edit scene name & action name to suit
- local play_speech = getObject('Scenes[Options_Menu].SceneActions[play_speech]') -- edit scene name & action name to suit
- if cond == true then
- check_vol = check_vol + 10
- if check_vol > 100 then check_vol = 100 end
- else
- check_vol = check_vol - 10
- if check_vol < 0 then check_vol = 0 end
- end
- setVolume(val, check_vol)
- -- plays a sound or speech file depending on current int defined!
- if val == 1 then
- startAction(play_sound)
- else
- if val == 2 then
- startAction(play_speech)
- else
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement