Changing music volume always at text?

  • #10, by afrlmeThursday, 11. February 2016, 16:44 5 years ago
    Yeah, you need to remove the if query bits from the 2 functions.
    -- * local variables * --
    local val = 10 -- amount to raise/lower the volume by...

    -- * text started lower volume * --
    function onTextStarted(text)
    if not Conditions["music_muted"].ConditionValue then setVolume(eMusicVolume, (getVolume(eMusicVolume) - val)) end
    end

    -- * text stopped raise volume * --
    function onTextStopped(text)
    if not Conditions["music_muted"].ConditionValue then setVolume(eMusicVolume, (getVolume(eMusicVolume) + val)) end
    end

    -- * the event listeners for text start & stop * --
    registerEventHandler("textStarted", "onTextStarted")
    registerEventHandler("textStopped", "onTextStopped")
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17

    ... assuming you are using the same script as above. I just removed the queries that check if the text belongs to a character. Now it should work for any displayed text.

    Imperator

    6956 Posts


  • #11, by wimfFriday, 12. February 2016, 14:52 5 years ago
    Thank you very much, It works perfectly!

    Forum Fan

    238 Posts

  • #12, by afrlmeFriday, 12. February 2016, 17:51 5 years ago
    No problem. smile

    Imperator

    6956 Posts

Write post