Script Change Gold.

omashu
Por omashu
em Scripts

omashu

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 12/04/12Posts: 12

Olá tou com um erro no meu script change gold, se alguem postase aki algum que possa pegar em ot 9.10 dou rep+.

Obrigado.

Leoxtibia

avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 22/06/08Posts: 489Gênero: Masculino

Testa com esse, é só substituir pelo seu e colocar as tags em actions.xml:

 

Tags:

 

<action itemid="2148" event="script" value="NOMEDOSEUARQUIVO.lua"/>

<action itemid="2152" event="script" value="NOMEDOSEUARQUIVO.lua"/>

<action itemid="2160" event="script" value="NOMEDOSEUARQUIVO.lua"/>

 

 

 

Arquivo.lua

 

 

 

local coins = {

[iTEM_GOLD_COIN] = {

to = ITEM_PLATINUM_COIN, effect = TEXTCOLOR_YELLOW

},

[iTEM_PLATINUM_COIN] = {

from = ITEM_GOLD_COIN, to = ITEM_CRYSTAL_COIN, effect = TEXTCOLOR_LIGHTBLUE

},

[iTEM_CRYSTAL_COIN] = {

from = ITEM_PLATINUM_COIN, effect = TEXTCOLOR_TEAL

}

}

 

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)

doSendAnimatedText(fromPosition, "$$$", coins[coin.to].effect)

elseif(coin.from ~= nil) then

doChangeTypeItem(item.uid, item.type - 1)

doPlayerAddItem(cid, coin.from, ITEMCOUNT_MAX)

doSendAnimatedText(fromPosition, "$$$", coins[coin.from].effect)

end

return true

end

 

 

sergiped.gif

gustavoMtek

avatar
Cavaleiro
Cavaleiro

INFOS

Grupo: CavaleiroRegistrado: 28/11/10Posts: 175

acho que esse deve funcionar

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

 

em actions.xml

<action itemid="2148" script="other/changegold.lua"/>
<action itemid="2152" script="other/changegold.lua"/>
<action itemid="2160" script="other/changegold.lua"/>

lolcx9.gif

omashu

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 12/04/12Posts: 12

Obrigado aos dois vou testar em casa tou no meu primo, rep+ pos 2 por ajudar