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

{request} please help :(

andrewss

Nice Member
Joined
Jun 12, 2010
Messages
122
Reaction score
1
Location
E G Y P T
hi
i have script the 100 gold when use changed to platinum
and the 100 platinum changed to crystal i want 100 crystal changed to 1 gold nugget
please help
if you helped me i will rep++

server=tfs 0.3.6
client=8.54
 
go to data > actions > other > changegold.lua

and copy paste this over it

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
	}
}

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
 
it's not work
i copy urs and in xml i write
Code:
    <action itemid="2157" event="script" value="other/changegold.lua"/>

when i use 100 crystal it's changed to 100 platinum
but when i say !buyaol the 100 crystal changed to 9 gold nuggets
 
you need all of these and the gold nugget one

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="XXXX" event="script" value="other/changegold.lua"/> --item id of the gold nugget--

and that should work, sorry for not posthig that part i thought you would have known
 
ok i have finished it i do some scripts who have the probleme and want script
gold:
Code:
function onUse(cid, item, frompos, item2, topos)
   	if item.itemid == 2148 and item.type == 100 then
   		doRemoveItem(item.uid,item.type)
   		doPlayerAddItem(cid,2152,1)
   		doPlayerSendTextMessage(cid,22,"You have changed 100 gp to 1 platnium coin")
   	elseif item.itemid == 2148 and item.type < 100 then
   		doPlayerSendTextMessage(cid,22,"You have to got 100 gp's to change for platinum coin")
   	end
   end
platinum:
Code:
function onUse(cid, item, frompos, item2, topos)
   	if item.itemid == 2152 and item.type == 100 then
   		doRemoveItem(item.uid,item.type)
   		doPlayerAddItem(cid,2160,1)
   		doPlayerSendTextMessage(cid,22,"You have changed 100 platinum to 1 crystal coin")
   	elseif item.itemid == 2152 and item.type < 100 then
   		doRemoveItem(item.uid,1)
   		doPlayerAddItem(cid,2148,100)
   		doPlayerSendTextMessage(cid,22,"You have changed 1 platinum to 100 gold coins")
   	end
   end
crystal:
Code:
function onUse(cid, item, frompos, item2, topos)
   	if item.itemid == 2160 and item.type == 100 then
   		doRemoveItem(item.uid,item.type)
   		doPlayerAddItem(cid,2157,1)
  		doSendAnimatedText(getPlayerPosition(cid), "$$$", TEXTCOLOR_LIGHTGREEN)
   	elseif item.itemid == 2160 and item.type < 100 then
   		doRemoveItem(item.uid,1)
   		doPlayerAddItem(cid,2152,100)
   		doPlayerSendTextMessage(cid,22,"You have changed 1 crystal coin to 100 platium coins")
   	end
   end
gold nugget:
Code:
function onUse(cid, item, frompos, item2, topos)
  	if doRemoveItem(item.uid,1) then
  		doSendAnimatedText(getPlayerPosition(cid), "$$$", TEXTCOLOR_TEAL)
  		doPlayerAddItem(cid,2160,100)
  	end
  end
ok finished
but delete the change gold script

rep++ if i helped :D
 
Back
Top