Postado Setembro 15, 2014 10 anos Gostária que esse NPC manda-se mensagem sem alguem falar com ele, tipo igual a NPC Aruda e o Towncryer de Thais, do Global. NPC: <?xml version="1.0" encoding="UTF-8"?> <npc name="Ithalo" script="data/npc/scripts/default.lua" walkinterval="1250" speed="100" walkradius="4" floorchange="0"> <health max="100" now="100"/> <look type="151" head="116" body="19" legs="114" feet="95" addons="2" mount="0"/> <parameters> <!--MESSAGES--> <parameter key="message_greet" value="Greetings, |PLAYERNAME|."/> <parameter key="message_farewell" value="Good bye, |PLAYERNAME|."/> <parameter key="message_needmoney" value="You don't have enough money."/> <parameter key="message_needspace" value="You do not have enough capacity."/> <parameter key="message_needmorespace" value="You do not have enough capacity for all items."/> <parameter key="message_idletimeout" value="Good bye."/> <parameter key="message_sendtrade" value="Here you find some utilities that can be very useful in your adventures."/> <parameter key="message_oncloseshop" value="Thank you, come back whenever you're in need of something else."/> <parameter key="message_alreadyfocused" value="|PLAYERNAME|, I am already talking to you."/> <parameter key="message_walkaway_male" value="Good bye."/> <parameter key="message_walkaway_female" value="Good bye."/> <!--SHOP--> <parameter key="module_shop" value="1"/> <parameter key="shop_buyable" value="light shovel,5710,100;rope,2120,50;hawser,6392,100;elvenhair rope,7731,150;pick,2553,50;shovel,2554,50;fishing rod,2580,100;bowl,2571,25;bowl,2572,25;bowl,2573,25;backpack,1988,50;bag,1987,25"/> </parameters> </npc> Só esqueci como é o código, mas a mensagem póde deixar que eu edito. Obrigado, no aguardo. Conlheça o projeto:
Postado Setembro 15, 2014 10 anos Solução Tente esse: 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 thinkCallback(cid) local rand = math.random(80,100) if rand == 80 then selfSay('Eae') end return true end function greetCallback(cid) return true end npcHandler:setCallback(CALLBACK_ONTHINK, thinkCallback) npcHandler:setCallback(CALLBACK_GREET, greetCallback) npcHandler:addModule(FocusModule:new()) Isso é um arquivo lua. Editado Setembro 15, 2014 10 anos por lucasromero (veja o histórico de edições)
Postado Setembro 16, 2014 10 anos Autor Tente esse: 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 thinkCallback(cid) local rand = math.random(80,100) if rand == 80 then selfSay('Eae') end return true end function greetCallback(cid) return true end npcHandler:setCallback(CALLBACK_ONTHINK, thinkCallback) npcHandler:setCallback(CALLBACK_GREET, greetCallback) npcHandler:addModule(FocusModule:new()) Isso é um arquivo lua. haha, funfou maninho. Vlw ae, reputado. Conlheça o projeto:
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.