Postado Maio 8, 2014 11 anos Solução 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) end function onThink() npcHandler:onThink() end function FUNCAO_NOME(cid, message, keywords, parameters, node) if(not npcHandler:isFocused(cid)) then return false end local storage = 50001 if getPlayerStorageValue(cid, storage) ~= 1 then if getPlayerItemCount(cid,2516) >= 1 then -- SE TIVER 1 OU MAIS ITEM COM ID 2516 if doPlayerRemoveItem(cid,2516,1) then -- remove 1 ITEM DO ITEM COM ID 2516 npcHandler:say('Here is your item!', cid) -- MENSAGEM AO REMOVER O ITEM doPlayerAddItem(cid,5908,1) -- ADD 1 ITEM COM ID 5908 setPlayerStorageValue(cid, storage, 1) end else npcHandler:say('Você não tem o item!', cid) end else npcHandler:say('Você já fez a quest!', cid) end end local node2 = keywordHandler:addKeyword({'teste'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'vocÊ quer testar a função desse script?'}) node2:addChildKeyword({'yes'}, FUNCAO_NOME, {npcHandler = npcHandler, onlyFocus = true, reset = true}) node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Até mais.', reset = true}) npcHandler:addModule(FocusModule:new()) STYLLER OT 2022
Postado Maio 8, 2014 11 anos Autor Rapaiz veihhhh você é o cara kkkkkkkkkkkkkkkkkkkk valeu ae amigo 3 vezes que você ajuda valeu mesmo
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.