• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

changegold script

mikebadeaux

Mapper
Joined
May 16, 2010
Messages
112
Reaction score
1
I need a changegold script ------it goes from Gp>Platnum>cc>gold nugget>gold ingot>christmas token>scarab coin
 
Code:
local ITEM_GOLD_NUGGET = 2157
local ITEM_GOLD_INGOT = 9971
local ITEM_CHRISTMAS_TOKEN = 6527
local ITEM_SCARAB_COIN = 2159
 
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, to = ITEM_GOLD_NUGGET, effect = TEXTCOLOR_TEAL
	},
	[ITEM_GOLD_NUGGET] = {
		from = ITEM_CRYSTAL_COIN, to = ITEM_GOLD_INGOT, effect = TEXTCOLOR_LIGHTGREEN
	},
	[ITEM_GOLD_INGOT] = {
		from = ITEM_GOLD_NUGGET, to = ITEM_CHRISTMAS_TOKEN effect = TEXTCOLOR_WHITE
	},
	[ITEM_CHRISTMAS_TOKEN] = {
		from = ITEM_CHRISTMAS_TOKEN, to = ITEM_SCARAB_COIN effect = TEXTCOLOR_RED
	}	
}
 
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
 
Back
Top