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

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

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 08-29-2019, 12:34 AM
jsr
Hill Giant
 
Join Date: Aug 2008
Location: melbourne
Posts: 187
Default Adding a pause to scripts

I'm trying to add a pause to an NPC script between statements while preserving the if block. So ideally, without using event_timer.

I tried using the threadmanager's wait function, but it doesn't do anything. I've referenced the example in http://wiki.eqemulator.org/p?Lua_NPC_Examples

This is from the example
Code:
local ThreadManager = require("thread_manager");
local evt;
 
function ability_one()
    evt.self:Emote("begins to cast something electrical");
    ThreadManager:Wait(2.5);
    evt.self:Shout("Feel the thunder!");
end

This is my implementation
Code:
function event_say(e)

	local tm = require("thread_manager")
	
	if e.message:findi("hail") then
	
		e.self:Say("A message")
		tm:Wait(5)
		e.self:Say("B message")
		tm:Wait(5000)
		e.self:Say("C message")
	end
end
A, B, and C message all display at once, and no quest errors are generated. Does anyone know why this wouldn't work?
Reply With Quote
 


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 11:11 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