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

Solved Problem with Gold Nuggets PLEASe Help

jakehop22

New Member
Joined
Dec 19, 2009
Messages
31
Reaction score
1
Please if anyone can help, help! ++REP if helped.
I keep getting this error in my server (GUI version) of TFS 0.3.6 p1.
Code:
[30/06/2010 13:27:40] [Error - Action Interface] 
[30/06/2010 13:27:40] data/actions/scripts/other/changegold.lua
[30/06/2010 13:27:40] Description: 
[30/06/2010 13:27:40] data/actions/scripts/other/changegold.lua:13: table index is nil
[30/06/2010 13:27:40] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/other/changegold.lua)

This is what I have in changegold.lua:
Code:
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
	},
	[ITEM_GOLD_NUGGET] = {
		from = ITEM_CRYSTAL_COIN, effect = TEXTCOLOR_SILVER
	}
}

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

This is what I have in actions.xml for changing gold:
Code:
	<!-- Change gold -->
	<action itemid="2148" event="script" value="other/changegold.lua"/>
	<action itemid="2152" event="script" value="other/changegold.lua"/>
	<action itemid="2157" event="script" value="other/changegold.lua"/>
	<action itemid="2160" event="script" value="other/changegold.lua"/>

This is what I have in items.xml for Gold Nugget:
Code:
	<item id="2157" article="a" name="gold nugget" plural="gold nuggets">
		<attribute key="weight" value="10" />
		<attribute key="worth" value="1000000" />
	</item>

I followed this tutorial (Sorry for posting link to another site):
LUA-NEW!-Money-ivory-coins

Please can anyone help me!? ++REP if helped.
Thanks.
 
Last edited:
Back
Top