Postado Janeiro 30, 2024 1 ano 21 horas atrás, L3K0T disse: local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} local item1 = 123 -- item local qntd1 = 1 -- quantia local stor = 1023332 local function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end local function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end local function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end local function onThink() npcHandler:onThink() end local function creatureSayCallback(cid, type, msg) if not npcHandler:isFocused(cid) then return false end local talkUser = npcHandler:isConvincing() and 0 or cid if msgcontains(msg, 'entregar') then selfSay('Voce conseguiu mesmo juntar os itens? Diga {sim} se deseja me entregar', cid) talkState[talkUser] = 1 elseif msgcontains(msg, 'sim') and talkState[talkUser] == 1 then if getPlayerStorageValue(cid, stor) > 0 then selfSay('Voce ja realizou a troca comigo.', cid) else if getPlayerItemCount(cid, item1) >= qntd1 then doPlayerRemoveItem(cid, item1, qntd1) local bag = doPlayerAddItem(cid, 1599, 1) doAddContainerItem(bag, 2190, 10) setPlayerStorageValue(cid, stor, 1) selfSay('Obrigado! Em troca, aqui esta o seu premio.', cid) else selfSay('Voce ainda nao conseguiu os requisitos. Estou ansioso por eles, ha tantas utilidades.', cid) end end return true end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Esse NPC não é compatível com o Canary!!!
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.