eu tenho esse que só leva para uma city tem como adaptar para 3 lugares?
local tab = {
storage = 10015,
pos = {x = 2205, y = 573, z = 7},
}
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg:lower()) end
function onThink() npcHandler:onThink() end
local talkState = {}
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
if msgcontains(msg, "city1") then
selfSay("Você deseja viajar para city1?", cid)
talkState[talkUser] = 1
elseif msgcontains(msg, "yes") and talkState[talkUser] == 1 then
if getPlayerStorageValue(cid, tab.storage) > 0 and getPlayerLevel(cid) >= 250 then
selfSay("Chegamos!", cid)
doSendMagicEffect(getThingPos(cid), 10)
npcHandler:releaseFocus(cid)
doTeleportThing(cid, tab.pos)
doSendMagicEffect(tab.pos, 10)
else
selfSay("você não pode viajar", cid)
end
talkState[talkUser] = 0
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())