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

100cc to 1shim perl

WiLDTuRTLE

Member
Joined
Feb 26, 2011
Messages
478
Reaction score
5
function onUse(cid, item, frompos, item2, topos)
if item.itemid == 2160 and item.type == 100 then
doSendAnimatedText(frompos,"$$$$",30);
doRemoveItem(item.uid,item.type)
doPlayerAddItem(cid,7632,1)
elseif item.itemid == 2160 and item.type < 100 then
doSendAnimatedText(frompos,"$$",30);
doRemoveItem(item.uid,1)
doPlayerAddItem(cid,2152,100)
end
end




Whats wrong in it? when i got 100 cc it works like if i had 1cc , it goes into platinum
thanks for the answers
 
LUA:
local  SHRIM_ID = 7632
local coins = {
			[ITEM_CRYSTAL_COIN] = {
				from = ITEM_PLATINUM_COIN, to = SHRIM_ID, effect = COLOR_TEAL
	},
[SHRIM_ID] = {
				to = ITEM_PLATINUM_COIN, effect = COLOR_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)
				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
 
Back
Top