• 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!

Change gold help

Dexftw

Total Boss
Joined
Jan 30, 2011
Messages
317
Reaction score
8
What's up can I get the script for changing crystal coin x100 into gold nuggets? Would appreciate it i tinkered but kept getting can not use button on the CC stack
 
Go to data/actions/scripts and create a new LUA file.

changegold.LUA
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, to = ITEM_GOLD_NUGGET, effect = TEXTCOLOR_TEAL
	},

	[ITEM_GOLD_NUGGET] = {
		from = ITEM_PLATINUM_COIN, effect = TEXTCOLOR_ORANGE
	}
}

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

Now go to actions.xml and add this:

XML:
	<!-- Change gold -->
	<action itemid="2148" event="script" value="changegold.lua"/>
	<action itemid="2152" event="script" value="changegold.lua"/>
	<action itemid="2160" event="script" value="changegold.lua"/>
        <action itemid="2157" event="script" value="changegold.lua"/>
 
Yeah.. I did search that's the one I read and it's still not working for some reason, I've reloaded triple checked, would be nice if TFS would give me an error in the console but nope.avi.
 
Back
Top