M i s s 9 Posted November 16, 2018 Report Share Posted November 16, 2018 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. Link to comment https://xtibia.com/forum/topic/248578-resolvido-npc-teleport-um-player-a-cada-2-horas/ Share on other sites More sharing options...
1 Marshmello 271 Posted November 16, 2018 Report Share Posted November 16, 2018 Spoiler 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()) M i s s 1 Link to comment https://xtibia.com/forum/topic/248578-resolvido-npc-teleport-um-player-a-cada-2-horas/#findComment-1745654 Share on other sites More sharing options...
0 Marshmello 271 Posted November 17, 2018 Report Share Posted November 17, 2018 O pedido neste tópico de foi atendido e/ou o autor do tópico resolveu sua duvida. Este tópico está fechado e foi movido para Pedidos - Resolvidos. Se você tiver outros pedidos, crie um novo tópico. Link to comment https://xtibia.com/forum/topic/248578-resolvido-npc-teleport-um-player-a-cada-2-horas/#findComment-1745659 Share on other sites More sharing options...
Question
M i s s 9
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.
Link to comment
https://xtibia.com/forum/topic/248578-resolvido-npc-teleport-um-player-a-cada-2-horas/Share on other sites
2 answers to this question
Recommended Posts