Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::LUA

Quests::LUA Section regarding LUA scripts, help, questions, answers

Reply
 
Thread Tools Display Modes
  #1  
Old 06-08-2022, 12:39 AM
Steinwald's Avatar
Steinwald
Fire Beetle
 
Join Date: May 2022
Location: South Dakota
Posts: 1
Default 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
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 09:36 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3