Postado Novembro 1, 2015 9 anos Spoiler 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 npcHandler:setMessage(MESSAGE_GREET, "Hello |PLAYERNAME|. Say {halloween}.") local outfits = {857,853,852,851,843,837,833,785,720,659,597,549,544,523,510,878,877,890} local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_GREEN) function onTargetCreature(cid, target) doSetCreatureOutfit(target, math.random(#outfits), 3 * 24 * 3600 * 1000) end setCombatCallBack(combat, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature") setCombatArea(combat, createCombatArea({ {1,1,1,1,1}, {1,1,1,1,1}, {1,1,3,1,1}, {1,1,1,1,1}, {1,1,1,1,1} })) function creatureSayCallback(cid, type, msg) local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if(not npcHandler:isFocused(cid)) then return false end if(msg:lower() == "halloween") then doCombat(getNpcId(), combat, positionToVariant(getThingPos(getNpcId()))) npcHandler:say('You are Dead, Suprise!', talkUser) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
Postado Novembro 1, 2015 9 anos Autor 11 minutos atrás, MaTTch disse: Ocultar conteúdo 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 npcHandler:setMessage(MESSAGE_GREET, "Hello |PLAYERNAME|. Say {halloween}.") local outfits = {857,853,852,851,843,837,833,785,720,659,597,549,544,523,510,878,877,890} local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_GREEN) function onTargetCreature(cid, target) doSetCreatureOutfit(target, math.random(#outfits), 3 * 24 * 3600 * 1000) end setCombatCallBack(combat, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature") setCombatArea(combat, createCombatArea({ {1,1,1,1,1}, {1,1,1,1,1}, {1,1,3,1,1}, {1,1,1,1,1}, {1,1,1,1,1} })) function creatureSayCallback(cid, type, msg) local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if(not npcHandler:isFocused(cid)) then return false end if(msg:lower() == "halloween") then doCombat(getNpcId(), combat, positionToVariant(getThingPos(getNpcId()))) npcHandler:say('You are Dead, Suprise!', talkUser) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Deu erro na linha 18 SetCombatCallBack
Postado Novembro 1, 2015 9 anos Autor 2 minutos atrás, MaTTch disse: Troque setCombatCallBack = setCombatCallback Agora eu consigo sumonar o npc, falo com ele normalmente mas ele não da a outfit: 15:15 Halloween: Hello Samsumg. Say halloween. 15:15 Etsuko: Welcome, Samsumg! I have been expecting you. 15:15 Samsumg [1]: halloween 15:15 Halloween: You are Dead, Suprise!
Postado Novembro 1, 2015 9 anos Spoiler 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 npcHandler:setMessage(MESSAGE_GREET, "Hello |PLAYERNAME|. Say {halloween}.") local outfits = {857,853,852,851,843,837,833,785,720,659,597,549,544,523,510,878,877,890} local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_GREEN) function onTargetCreature(cid, target) doSetCreatureOutfit(target, {lookType = math.random(#outfits)}, 3 * 24 * 3600 * 1000) end setCombatCallback(combat, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature") setCombatArea(combat, createCombatArea({ {1,1,1,1,1}, {1,1,1,1,1}, {1,1,3,1,1}, {1,1,1,1,1}, {1,1,1,1,1} })) function creatureSayCallback(cid, type, msg) local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if(not npcHandler:isFocused(cid)) then return false end if(msg:lower() == "halloween") then doCombat(getNpcId(), combat, numberToVariant(getNpcId())) npcHandler:say('You are Dead, Suprise!', talkUser) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
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.