Postado Dezembro 11, 2012 12 anos Autor Up (1º) | [8.60] - Galaxy Server - Download (2º) | [8.60] - Glorious Server - Download (3º) | [8.60] - Epic Server - Download
Postado Dezembro 11, 2012 12 anos 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 if msgcontains(msg, 'present') and getPlayerVocation(cid) == 1 and getPlayerStorageValue(cid, 21718) < 1 then setPlayerStorageValue(cid, 21718, 1) doPlayerAddItem(cid,2160,1) selfSay("Pegue este item.", cid) if msgcontains(msg, 'present') and getPlayerVocation(cid) == 2 and getPlayerStorageValue(cid, 21718) < 1 then setPlayerStorageValue(cid, 21718, 1) doPlayerAddItem(cid,2160,1) selfSay("Pegue este item.", cid) if msgcontains(msg, 'present') and getPlayerVocation(cid) == 3 and getPlayerStorageValue(cid, 21718) < 1 then setPlayerStorageValue(cid, 21718, 1) doPlayerAddItem(cid,2160,1) selfSay("Pegue este item.", cid) if msgcontains(msg, 'present') and getPlayerVocation(cid) == 4 and getPlayerStorageValue(cid, 21718) < 1 then setPlayerStorageValue(cid, 21718, 1) doPlayerAddItem(cid,2160,1) selfSay("Pegue este item.", cid) end end end end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Testa ai. Onde ta verde vc poe ID do item. Vermelho o ID da vocaçao
Postado Dezembro 12, 2012 12 anos Autor @roriscrave não funcionou, veja se meu npc esta certo. o Arquivo LUA esta! <?xml version="1.0" encoding="UTF-8"?> <npc name="Santa Claus" script="data/npc/scripts/present.lua" floorchange="0" access="5" level="1" maglevel="1"> <health now="150" max="150"/> <look type="152" head="0" body="113" legs="113" feet="0" addons="2"/> <parameters> <parameter key="module_shop" value="1" /> <parameter key="message_greet" value="Hello |PLAYERNAME|. Bem Vindo ao Server tenha um ótimo Natal, diga Hi e depois Present e Yes" /> </parameters> </npc> Não da nenhum erro, mais quando fala "Present" e "Yes" ele não entrega o item. Editado Dezembro 12, 2012 12 anos por jNo (veja o histórico de edições) (1º) | [8.60] - Galaxy Server - Download (2º) | [8.60] - Glorious Server - Download (3º) | [8.60] - Epic Server - Download
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.