Olá Pessoal queria a ajuda de vocês com um NPC que funcione assim :
o player para conseguir viajar com o tal NPC precisará ter um x storage , e se puder colocar pra ele pedir 1 item com x quantidade,
para ele ter acesso ao lugar.
+REP
Olá Pessoal queria a ajuda de vocês com um NPC que funcione assim :
o player para conseguir viajar com o tal NPC precisará ter um x storage , e se puder colocar pra ele pedir 1 item com x quantidade,
para ele ter acesso ao lugar.
+REP
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 storage = 11234 -- Storage local pos = {x = 100, y = 200, z = 7} -- Local que ele será teleportado; local item = 2150 -- ID do item local count = 10 -- Count do item local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if(msgcontains(msg, 'travel')) then if getPlayerStorageValue(cid, storage) >= 1 then if doPlayerRemoveItem(cid, item, count) then doTeleportThing(cid, pos) selfSay('Thanks!!!', cid) else selfSay('you dont have the item', cid) end else selfSay('you dont have the storage', cid) end else selfSay('say [travel]', cid) end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
"O fracasso é a oportunidade de se começar de novo inteligentemente"