local keywordHandler = KeywordHandler:new()local npcHandler = NpcHandler:new(keywordHandler)NpcSystem.parseParameters(npcHandler)local talkState = {}function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) endfunction onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) endfunction onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) endfunction onThink() npcHandler:onThink() endlocal cfg = { toPos = {x=1039, y=563, z=7}, -- Posição que o jogador sera teleportado level = 1, -- Level necessário para ser teleportado price = 0, -- Dinheiro a ser cobrado para ser teleportado {x=1063, y=880, z=7}, {x=1063, y=881, z=7}, {x=1063, y=882, z=7}, {x=1063, y=883, z=7}, }local naopode = 0function 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, 'sim') then selfSay('You are sure you want to go? You can not return.', cid) talkState[talkUser] = 1 elseif talkState[talkUser] == 1 then if msgcontains(msg, 'yes') then naopode = 0 if getPlayerLevel(cid) >= cfg.level then for i = 1, 4 do if not isPlayer(getThingFromPos(cfg[i])) then naopode = 1 else naopode = 0 end end if naopode == 0 then if doPlayerRemoveMoney(cid, cfg.price) then for p = 1, 4 do doTeleportThing(getThingFromPos(cfg[p]), cfg.toPos) end talkState[talkUser] = 0 else selfSay('You don\'t have enough money.', cid) end else selfSay('Desculpe Mais Precisa de um grupo de 4 Players', cid) talkState[talkUser] = 0 end else selfSay('You need level having above '.. cfg.level ..'.', cid) end elseif msgcontains(msg, 'no') then selfSay('Skirt here!', cid) end endendnpcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)npcHandler:addModule(FocusModule:new())
Mano kkkkkkkkkkkk
Tô errando assim pq to enferrujado.




info
Grupo: Campones
Registrado: 01/06/17
Posts: 43
Reputação: +1
Gênero: Masculino
Char no Tibia: [ADM]Neq
11/06/2017 21:44:05] datapack/npc/scripts/jenny.lua:onCreatureSay [11/06/2017 21:44:05] Description: [11/06/2017 21:44:05] attempt to index a nil value [11/06/2017 21:44:05] stack traceback: [11/06/2017 21:44:05] [C]: in function 'getThingFromPos' [11/06/2017 21:44:05] datapack/npc/scripts/jenny.lua:37: in function 'callback' [11/06/2017 21:44:05] datapack/npc/lib/npcsystem/npchandler.lua:391: in function 'onCreatureSay' [11/06/2017 21:44:05] datapack/npc/scripts/jenny.lua:8: in function <datapack/npc/scripts/jenny.lua:8>