Postado Junho 7, 2018 7 anos Olá amigos, alguém poderia me ajudar a achar esse script. Script que transforma Gold em Platinum e Platinum em gold quando estiverem na quantidade 100, se possível explicar onde coloco, sou meio leigo no assunto ainda. Agradeço desde já, muito obrigado pela atenção.
Postado Junho 7, 2018 7 anos Vá em data/actions/scripts e cria um arquivo.lua nomeado changegold.lua function onUse(cid, item, fromPosition, itemEx, toPosition) if item.itemid == ITEM_GOLD_COIN and item.type == ITEMCOUNT_MAX then doChangeTypeItem(item.uid, item.type - item.type) doPlayerAddItem(cid, ITEM_PLATINUM_COIN, 1) doSendAnimatedText(fromPosition, "$$$", TEXTCOLOR_PLATINUMBLUE) elseif item.itemid == ITEM_PLATINUM_COIN and item.type == ITEMCOUNT_MAX then doChangeTypeItem(item.uid, item.type - item.type) doPlayerAddItem(cid, ITEM_CRYSTAL_COIN, 1) doSendAnimatedText(fromPosition, "$$$", TEXTCOLOR_TEAL) elseif item.itemid == ITEM_PLATINUM_COIN and item.type < ITEMCOUNT_MAX then doChangeTypeItem(item.uid, item.type - 1) doPlayerAddItem(cid, ITEM_GOLD_COIN, ITEMCOUNT_MAX) doSendAnimatedText(fromPosition, "$$$", TEXTCOLOR_YELLOW) elseif item.itemid == ITEM_CRYSTAL_COIN then doChangeTypeItem(item.uid, item.type - 1) doPlayerAddItem(cid, ITEM_PLATINUM_COIN, ITEMCOUNT_MAX) doSendAnimatedText(fromPosition, "$$$", TEXTCOLOR_PLATINUMBLUE) else return FALSE end return TRUE end Agora vá em data/actions/actions.xml e adicione essa linha antes de </actions> <!-- Gold / platinum / ccrystal --> <action itemid="2148" script="changegold.lua"/> <action itemid="2152" script="changegold.lua"/> <action itemid="2160" script="changegold.lua"/> Se quiser adicionar outra moeda, pode usar esse código que eu uso: Você terá que trocar os X pelos ids das moedas, exemplo: X1 - ID DA MOEDA 1, GOLD COIN... X2 - ID DA MOEDA 2, PLATINUM COIN... X3 ... X4 ... X5 ... Mas se for criar uma nova moeda me avise, é preciso fazer outra configuração em items.xml, além disso você precisa adicionar os ids das moedas novas que colocar aqui no actions.xml, exatamente como os três IDS que eu passei pra você ali em cima. local coins = { [X1] = {to = X2}, [X2] = {to = X3, from = X1}, [X3] = {to = X4, from = X2}, [X4] = {to = X5, from = X3}, [X5] = {from = X4}, } function onUse(cid, item, fromPosition, itemEx, toPosition) if(getPlayerFlagValue(cid, PLAYERFLAG_CANNOTPICKUPITEM)) then return false end local coin = coins[item.itemid] if(not coin) then return false end if(coin.to ~= nil and item.type == ITEMCOUNT_MAX) then doChangeTypeItem(item.uid, item.type - item.type) doPlayerAddItem(cid, coin.to, 1) elseif(coin.from ~= nil) then doChangeTypeItem(item.uid, item.type - 1) doPlayerAddItem(cid, coin.from, ITEMCOUNT_MAX) end return true end Editado Junho 7, 2018 7 anos por Daniel (veja o histórico de edições) Ot Design: https://discord.gg/VgtVRNmCD7
Postado Março 25, 2020 5 anos Ola, entao o script esta funcionando, mas quando clico no crystal ele some!! e quando clico em 100 platinum ou 100 gold da que nao posso usar esse iten pode me ajudar? Editado Março 25, 2020 5 anos por Dorso (veja o histórico de edições)
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.