Postado Janeiro 25, 2015 10 anos Galera tenho um NPC que desejo que ele teletransporte o player para um local, mas para teletransportar ele irá REMOVER os itens que o NPC pedir. Exemplo: O player tem Demon Armor e Demon Legs e ao falar com o NPC ele irá teleportá-lo e removerá esses 2 itens. Porém estou com um problema, ele está teletransportando, mas não está recolhendo os items. Alguém me da essa força, dou rep++. Obs: Versão do OT 8.60 SCRIPT Abaixo. 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 local item1 = 2494 --Demon Armor local qntd1 = 1 --Quantidade do item 1 local item2 = 2495 --Demon Legs local qntd2 = 1 --Quantidade do item 2 local pos = {x=201, y=259, z=7} --Posicao pra onde o player vai ser teleportado local stor = 6967 function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end if msgcontains(msg, 'yes') then selfSay('To do this quest you need to give me a Demon Armor and a Demon Legs. Do you have it?', cid) if msgcontains(msg, 'yes') then if getPlayerItemCount(cid, item1) >= qntd1 and getPlayerItemCount(cid, item2) >= qntd2 then if getPlayerStorageValue(cid, stor) ~= 1 then doTeleportThing(cid, pos) doSendMagicEffect(getThingPos(cid), 13) setPlayerStorageValue(cid, stor, 1) else selfSay('Voce ja fez esta quest.', cid) end else selfSay('Voce nao tem os itens necessarios pra fazer esta quest.', cid) end elseif msgcontains(msg, 'no') then selfSay('So go away! I have nothing to you.', cid) end end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
Postado Janeiro 25, 2015 10 anos 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 local item1 = 2494 --Demon Armor local qntd1 = 1 --Quantidade do item 1 local item2 = 2495 --Demon Legs local qntd2 = 1 --Quantidade do item 2 local pos = {x=201, y=259, z=7} --Posicao pra onde o player vai ser teleportado local stor = 6967 function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end if msgcontains(msg, 'yes') then selfSay('To do this quest you need to give me a Demon Armor and a Demon Legs. Do you have it?', cid) if msgcontains(msg, 'yes') then if getPlayerItemCount(cid, item1) >= qntd1 and getPlayerItemCount(cid, item2) >= qntd2 then if getPlayerStorageValue(cid, stor) ~= 1 then doTeleportThing(cid, pos) doSendMagicEffect(getThingPos(cid), 13) setPlayerStorageValue(cid, stor, 1) doPlayerRemoveItem(cid, item1, qntd1) doPlayerRemoveItem(cid, item2, qntd2) else selfSay('Voce ja fez esta quest.', cid) end else selfSay('Voce nao tem os itens necessarios pra fazer esta quest.', cid) end elseif msgcontains(msg, 'no') then selfSay('So go away! I have nothing to you.', cid) end end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Na próxima, pra ajudar a gente, poe em code o código... _ .-'` `} _./) / } .'o \ | } '.___.'`.\ {` /`\_/ , `. } ME DA UMA NOZ! \=' .-' _`\ { `'`;/ `, } _\ @ ; } /__`;-...'--' Cluck!
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.