• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[AddEvent] NPC Talk Delay

przemek1991

New Member
Joined
Feb 17, 2008
Messages
25
Reaction score
0
hi, can someone can tell me how to do a time delay in normal talk i have done something like this and i dont work :( i really dont know how to do it
Code:
if msgcontains(msg, 'xxx') and talk_state == 1 then 
npcHandler:say('xxx', cid)
addEvent(2*1000, delay) -- < there i need a 2 sec delay between these 2 msg
npcHandler:say('xxx', cid)
talk_state = 2
setPlayerStorageValue(cid, 10002,0)
 
Use "wait" function

Test this example.. i don't know if this works
Lua:
npcHandler:say('xxx', cid)
wait(2000) --2 seconds
npcHandler:say('xxx', cid)
 
this doesn't work ;( i have 0.3.4 rev 55, I writed that and other npc from end of the map reponded after 2sec
Lua:
function odp()
npcHandler:say('xxx', cid)
end
Lua:
npcHandler:say('xxx', cid)
addEvent(odp, 2*1000, cid)
 
Last edited:
Back
Top