EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::LUA (https://www.eqemulator.org/forums/forumdisplay.php?f=680)
-   -   Getting an NPC to play a custom MP3 file in LUA. (https://www.eqemulator.org/forums/showthread.php?t=43652)

Steinwald 06-08-2022 12:39 AM

Getting an NPC to play a custom MP3 file in LUA.
 
Hello,

I'm new here to EQemulator and are in the process of building a unique server called The Hungry Vulture. The problem that I am having is getting an NPC to play the custom voice mp3 that I created for it. I appreciate any help somebody could offer.


Edited & Solved: After a little troubleshooting and experimenting, I figured out you need to do it with a quick Set_Timer while also finding the client with the npc. I'll leave this working example here.


Code:

function event_say(e)

    if(e.message:findi("hail")) then
        client_to_check=eq.get_entity_list():GetClientByID(e.other:GetID());
        eq.set_timer("greeting", 100); -- 0.1 seconds
        e.self:Say("Test");
    end

end


function event_timer(e)

    if (e.timer == ("greeting")) then
          e.self:Say("Timer Works");
          client_to_check:PlayMP3("Corpsepicker_Greeting.mp3");
          eq.stop_timer("greeting");
    end

end



All times are GMT -4. The time now is 05:35 PM.

Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.