Postado Setembro 27, 2012 12 anos Olá pessoal, gostaria de pedir um script aqui! Nome do Script: AutoChangeGold Tipo do Script: Não sei o tipo que é! Versão Utilizada: 9.60 Servidor Utilizado: The Forgotten Server Nível de Experiência: Intermediário, Avançado Informações Extras: Script que quando o player tiver 100 gold coins ou mais então transformar automaticamente em 1 platinum, exemplo: 547 Gold Coint se transforma em 5 Platinum Coins e sobram 47 Gold Coin, e se o cara tiver 100 Platinum Coins, transformar automaticamente em Crystal Coin, exemplo: 390 Platinum Coins se transforma em 3 Crystal Coin e sobram 90 Platinum Coins. Script funcionando data/creaturescripts/scripts/coins.lua -- Auto Change Gold function onThink(cid, interval) if(not isCreature(cid)) then return end local plat = math.floor(getPlayerItemCount(cid, 2148)/100) if(plat > 0) then doPlayerRemoveItem(cid, 2148, plat*100) doPlayerAddItem(cid, 2152, plat) end local crys = math.floor(getPlayerItemCount(cid, 2152)/100) if(crys > 0) then doPlayerRemoveItem(cid, 2152, crys*100) doPlayerAddItem(cid, 2160, crys) end end data/creaturescripts/scripts/login.lua, antes do último return true -- Auto Change Gold registerCreatureEvent(cid, "Coins") data/creaturescripts/creaturescripts.xml <event type="think" name="Coins" event="script" value="coins.lua"/> -- Auto Change Gold Um abraço! Editado Setembro 29, 2012 12 anos por dezon (veja o histórico de edições)
Postado Setembro 27, 2012 12 anos data/actions.xml <action itemid="2148" event="script" value="other/changegold.lua"/> <action itemid="2152" event="script" value="other/changegold.lua"/> <action itemid="2160" event="script" value="other/changegold.lua"/> data/actions/scripts Citar local scarabid = 9971 local scarabtext = TEXTCOLOR_DARKORANGE 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_LIGHTBLUE) 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_CRYSTAL_COIN and item.type == ITEMCOUNT_MAX then doChangeTypeItem(item.uid, item.type - item.type) doPlayerAddItem(cid, scarabid, 1) doSendAnimatedText(fromPosition, "$$$$", scarabtext) 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 and item.type < ITEMCOUNT_MAX then doChangeTypeItem(item.uid, item.type - 1) doPlayerAddItem(cid, ITEM_PLATINUM_COIN, ITEMCOUNT_MAX) doSendAnimatedText(fromPosition, "$$", TEXTCOLOR_LIGHTBLUE) elseif item.itemid == scarabid then doChangeTypeItem(item.uid, item.type - 1) doPlayerAddItem(cid, ITEM_CRYSTAL_COIN, ITEMCOUNT_MAX) doSendAnimatedText(fromPosition, "$$$", TEXTCOLOR_TEAL) else return FALSE end return TRUE end
Postado Setembro 27, 2012 12 anos n vei, ele pediu automaticamente n clicando, clicando todo sv já tem, amigo vou tentar criar seu script aqui, me passa os ids dos 3 coin. @Edit. Fiz o script em data/creaturescripts/scripts copie qualquer arquivo.lua e renomeie para coins dentro adicione function onThink(cid, interval) if getPlayerItemCount(cid, 2148) == 100 then doPlayerRemoveItem(cid, 2148,100) doPlayerAddItem(cid,2152,1) elseif getPlayerItemCount(cid,2152) == 100 then doPlayerRemoveItem(cid, 2152,100) doPlayerAddItem(cid,2160,1) end return true end em data/creaturescripts/scripts/login.lua antes do ultimo return true adicione registerCreatureEvent(cid, "Coins") em data/creaturescripts/creaturescripts.xml adicione <event type="think" name="Coins" event="script" value="coins.lua"/> Editado Setembro 27, 2012 12 anos por 1215171 (veja o histórico de edições) Ae ajudei? Rep+
Postado Setembro 27, 2012 12 anos Autor Em 27/09/2012 em 21:31, 1215171 disse: n vei, ele pediu automaticamente n clicando, clicando todo sv já tem, amigo vou tentar criar seu script aqui, me passa os ids dos 3 coin. @Edit. Fiz o script em data/creaturescripts/scripts copie qualquer arquivo.lua e renomeie para coins dentro adicione function onThink(cid, interval) if getPlayerItemCount(cid, 2148) == 100 then doPlayerRemoveItem(cid, 2148,100) doPlayerAddItem(cid,2152,1) elseif getPlayerItemCount(cid,2152) == 100 then doPlayerRemoveItem(cid, 2152,100) doPlayerAddItem(cid,2160,1) end return true end em data/creaturescripts/scripts/login.lua antes do ultimo return true adicione registerCreatureEvent(cid, "Coins") em data/creaturescripts/creaturescripts.xml adicione <event type="think" name="Coins" event="script" value="coins.lua"/> Bom, primeiro obrigado pela resposta! Eu testei e não funcionou, veja como ficou: http://i.imgur.com/joYu3.png http://i.imgur.com/DOLPQ.png http://i.imgur.com/DhgER.png E mesmo assim nada acontece no tibia: http://i.imgur.com/Q10nj.jpg Obrigado! Em 27/09/2012 em 21:05, raell5 disse: data/actions.xml <action itemid="2148" event="script" value="other/changegold.lua"/> <action itemid="2152" event="script" value="other/changegold.lua"/> <action itemid="2160" event="script" value="other/changegold.lua"/> data/actions/scripts Obrigado cara, mas não é bem isso que eu queria ! Em 27/09/2012 em 20:53, Winfernus disse: Coloque o script ! Obrigado pela resposta, coloquei !
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.