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

How To Make 100 Golden Nugget Be 1 ingot ;)

bodycarcoo11

Mapper
Joined
Apr 26, 2011
Messages
213
Reaction score
9
Location
USA
Hello And Welcome Lets Start Use Notbad
Put This In ../data/actions/scripts/ingot.lua
Code:
function onUse(cid, item, frompos, item2, topos)
   	if item.itemid == 2157 and item.type == 100 then
   		doRemoveItem(item.uid,item.type)
   		doPlayerAddItem(cid,9971,1)
  		doSendAnimatedText(getPlayerPosition(cid), "$$$", TEXTCOLOR_LIGHTGREEN)
   	elseif item.itemid == 2157 and item.type < 100 then
   		doRemoveItem(item.uid,1)
   		doPlayerAddItem(cid,9971,100)
   		doPlayerSendTextMessage(cid,22,"You have changed 100 golden nuggets to 1 Golden Ingot")
   	end
   end
And Put This in ../data/actions/actions.xml
Code:
<action itemid="9971" event="script" value="other/ingot.lua"/>
If You Like REP++
 
Why doesn't he use
Lua:
-- Lua tags? o.O


And he said in the first line;
Hello And Welcome Lets Start Use Notbad
 
As a mod


XML:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="change-gold" version="1.0" author="The Forgotten server edited by Cyro" contact="**********" enabled="yes">
	<action itemid="2148;2152;2160;2157;9971" event="script" override="yes"><![CDATA[
		local coins = {
			[ITEM_GOLD_COIN] = {
				to = ITEM_PLATINUM_COIN, effect = COLOR_YELLOW
			},
			[ITEM_PLATINUM_COIN] = {
				from = ITEM_GOLD_COIN, to = ITEM_CRYSTAL_COIN, effect = COLOR_LIGHTBLUE
			},
			[ITEM_CRYSTAL_COIN] = {
				from = ITEM_PLATINUM_COIN, effect = COLOR_TEAL
			},
			[ITEM_GOLD_NUGGET] = {
				from = ITEM_CRYSTAL_COIN, effect = COLOR_YELLOW
			},
			[ITEM_GOLD_INGOT] = {
				from = ITEM_GOLD_NUGGET, effect = COLOR_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 ~= nil and item.type == ITEMCOUNT_MAX) then
				doChangeTypeItem(item.uid, item.type - item.type)
				doPlayerAddItem(cid, coin.to, 1)
				doPlayerSendTextMessage(cid, MESSAGE_EXPERIENCE, "$$$", ITEMCOUNT_MAX, coins[coin.to].effect, getCreaturePosition(cid))
			elseif(coin.from ~= nil) then
				doChangeTypeItem(item.uid, item.type - 1)
				doPlayerAddItem(cid, coin.from, ITEMCOUNT_MAX)
				doPlayerSendTextMessage(cid, MESSAGE_EXPERIENCE, "$$$", ITEMCOUNT_MAX, coins[coin.from].effect, getCreaturePosition(cid))
			end

			return true
		end
	]]></action>
</mod>

In items.xml

XML:
<item id="2157" article="a" name="gold nugget" plural="gold nuggets">
		<attribute key="weight" value="10" />
		<attribute key="worth" value="1000000" />
	</item>

And


XML:
<item id="9971" article="a" name="gold ingot" plural="gold ingots">
		<attribute key="weight" value="10" />
		<attribute key="worth" value="100000000" />
	</item>
 
Last edited:
Back
Top