local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid
local pos = {x=1025, y=223, z=7}
if (msgcontains(msg, 'yes') or msgcontains(msg, 'yes'))then
talkState[talkUser] = 1
if getGlobalStorageValue(484845) < os.time() then
doTeleportThing(cid, pos)
setGlobalStorageValue(484845, os.time() + 7200)
else
selfSay('Um treinador já passou por aqui, aguarde 2horas para viajar novamente',cid)
end
elseif msg == "no" then
selfSay("Then not", cid)
talkState[talkUser] = 0
npcHandler:releaseFocus(cid)
end
return TRUE
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())


info
Grupo: Visconde
Registrado: 09/05/18
Posts: 267
Reputação: +9
Gênero: Feminino
Char no Tibia: Merascylla
Preciso de um Npc que teleport um player a cada 2 horas ai depois dessa 2 horas outro player pode falar com o npc e ir para o local.