Chopperr 0 Postado Outubro 14, 2010 Share Postado Outubro 14, 2010 Olá galera, achei um script de renovar a soft e a firewalker por 10k apenas clicando nela, porém quando clico aparece o seguinte erro no console: [14/10/2010 14:22:51] [Error - Action Interface] [14/10/2010 14:22:51] data/actions/scripts/other/firewalker.lua:onUse [14/10/2010 14:22:51] Description: [14/10/2010 14:22:51] (luaDoRemoveItem) Item not found e: [14/10/2010 14:22:04] [Error - Action Interface] [14/10/2010 14:22:04] data/actions/scripts/other/softboots.lua:onUse [14/10/2010 14:22:04] Description: [14/10/2010 14:22:04] (luaDoRemoveItem) Item not found As duas são recarregadas normalmente, mas não cobra nada por isso! Ou seja, a pessoa clica na boots e o dinheiro requisitado não some! Vou postar aqui os dois scripts para quem entende me ajudar: function onUse(cid, item, fromPosition, itemEx, toPosition) local moneyneed = 10000 -- price to get new firewalker boots local playermoney = getPlayerMoney(cid) if playermoney >= moneyneed then if doPlayerTakeItem(cid, 10022, 1) then doRemoveItem(item.uid,1) doPlayerAddItem(cid, 9933, 1) doPlayerRemoveMoney(cid, moneyneed) doSendMagicEffect(fromPosition,12) else doPlayerSendTextMessage(cid,20, "You don't have worn firewalker boots.") end else doPlayerSendTextMessage(cid,20, "Sorry, but you need ".. moneyneed .." gold coins to get a new firewalker boots.") end end function onUse(cid, item, fromPosition, itemEx, toPosition) local moneyneed = 10000 -- price to get new soft boots local playermoney = getPlayerMoney(cid) if playermoney >= moneyneed then if doPlayerTakeItem(cid, 10021, 1) then doRemoveItem(item.uid,1) doPlayerAddItem(cid, 6132, 1) doPlayerRemoveMoney(cid, moneyneed) doSendMagicEffect(fromPosition,12) else doPlayerSendTextMessage(cid,20, "You don't have worn soft boots.") end else doPlayerSendTextMessage(cid,20, "Sorry, but you need ".. moneyneed .." gold coins to get a new soft boots.") end end Valeu! Link para o comentário https://xtibia.com/forum/topic/142957-problema-com-um-script/ Compartilhar em outros sites More sharing options...
Garou12 6 Postado Outubro 14, 2010 Share Postado Outubro 14, 2010 (editado) Olá, Chopperr. Tente usar o código abaixo: local c = { needMoney = 10000 } local boots = { [10021] = 6321, [10022] = 9933 } function onUse(cid, item, fromPosition, itemEx, toPosition) if(boots[item.itemid]) then if(doPlayerRemoveMoney(cid, c.needMoney)) then doTransformItem(item.uid, boots[item.itemid]) doSendMagicEffect(fromPosition, 12) else doPlayerSendCancel(cid, "You need ".. c.needMoney .." to repair ".. getItemInfo(item.itemid).name .."") end end return true end Tomei a liberdade de resumir os dois códigos passados no tópico em um só, logo você deve registrar o arquivo no actions.xml da seguinte forma: <action itemid="10021;10022" event="script" value="NOME_DO_ARQUIVO.lua"/> Editado Outubro 14, 2010 por Garou Link para o comentário https://xtibia.com/forum/topic/142957-problema-com-um-script/#findComment-945484 Compartilhar em outros sites More sharing options...
Chopperr 0 Postado Outubro 15, 2010 Autor Share Postado Outubro 15, 2010 nossa cara ainda melhorou o script! brigadããão mesmo! rep+ ah, só uma coisinha no seu script: local c = { needMoney = 10000 } local boots = { [10021] = 6321, [10022] = 9933 } function onUse(cid, item, fromPosition, itemEx, toPosition) if(boots[item.itemid]) then if(doPlayerRemoveMoney(cid, c.needMoney)) then doTransformItem(item.uid, boots[item.itemid]) doSendMagicEffect(fromPosition, 12) else doPlayerSendCancel(cid, "You need ".. c.needMoney .." to repair ".. getItemInfo(item.itemid).name .."") end end return true end ali aonde tá [10021] = 6321, o id está errado! o certo é 6132! eu fui testar na primeira vez e trocou a worn soft boots por um destroyer morto Quem for pegar também pegue esse que eu concertei: local c = { needMoney = 10000 } local boots = { [10021] = 6132, [10022] = 9933 } function onUse(cid, item, fromPosition, itemEx, toPosition) if(boots[item.itemid]) then if(doPlayerRemoveMoney(cid, c.needMoney)) then doTransformItem(item.uid, boots[item.itemid]) doSendMagicEffect(fromPosition, 12) else doPlayerSendCancel(cid, "You need ".. c.needMoney .." to repair ".. getItemInfo(item.itemid).name .."") end end return true end Link para o comentário https://xtibia.com/forum/topic/142957-problema-com-um-script/#findComment-945610 Compartilhar em outros sites More sharing options...
Posts Recomendados