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

Lua ingot problem, out of ideas

Wavoz

Oldschooler
Joined
Jul 10, 2011
Messages
1,009
Reaction score
81
I really don't know what to do anymore, EVERYTHING makes sense and is supposed to be working BUT ITS NOT.

Lua:
local ITEM_GOLD_INGOT = 9971
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_INGOT, effect = TEXTCOLOR_TEAL
	},
	[ITEM_GOLD_INGOT] = {
		from = ITEM_CRYSTAL_COIN, effect = TEXTCOLOR_YELLOW
	}
}

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 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) then
		doChangeTypeItem(item.uid, item.type - 1)
		doPlayerAddItem(cid, coin.from, ITEMCOUNT_MAX)
		doSendAnimatedText(fromPosition, "$$$", coins[coin.from].effect)
	end
	return true
end

I have tried this:
Lua:
	<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"/>  
	<action itemid="9971" event="script" value="other/changegold.lua"/>

and this
Lua:
	<action itemid="2148;2152;2160;9971" event="script" value="other/changegold.lua"/>
I have added ITEM_GOLD_INGOT = 9971 to lib, i have added value to gold ingot in items.xml

Gold Ingots are transforming back to crystal coins, but 100 crystal coins are not transforming into 1 gold ingot. It like it doesn't get ITEMCOUNT_MAX on crystal coins...

There are 10000 of threads like this, i have tried every single script of changegold.lua none of them works.

It's rev5968 downgraded to 8.6.

- - - Updated - - -

Thread can be closed ;)

Managed to solve it on my own, there was a mod for changing gold, i had to disable it.

- - - Updated - - -

Thread can be closed ;)

Managed to solve it on my own, there was a mod for changing gold, i had to disable it.
 

Similar threads

Back
Top