Rizz
Quited with Tibia/OT
Only works in 0.3.5pl2 or higher.
Example Usage:
Can be unlimited amount of msgs. 10000 is time between msgs = 10 seconds, default is 10 seconds as well.
Based it on the other older script. Credits to the creator of that one.
Rizz
Lua:
function doCreatureSayWithDelay(cid,text,type,delay,e,pcid)
if delay<=0 then
doCreatureSay(cid,text,type, false,pcid)
else
local func=function(pars)
doCreatureSay(pars.cid,pars.text,pars.type, false,pars.pcid)
pars.e.done=TRUE
end
e.done=FALSE
e.event=addEvent(func,delay,{cid=cid, text=text, type=type, e=e,pcid=pcid})
end
end
function doNPCTalkALot(msgs,interval,pcid)
local e={}
local ret={}
if interval==nil then interval=10000 end --10 seconds is default time between messages
for aux=1,table.getn(msgs) do
e[aux]={}
doCreatureSayWithDelay(getNpcCid(),msgs[aux],TALKTYPE_PRIVATE_NP,(aux-1)*interval,e[aux],pcid)
table.insert(ret,e[aux])
end
return(ret)
end
Example Usage:
Lua:
doNPCTalkALot({"Message One...", "Message Two...", "Message 3...", "Last Message."}, 10000, cid)
Based it on the other older script. Credits to the creator of that one.
Rizz
Last edited: