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

Mine Script help

Blackcody

RiseOfTibia Owner
Joined
Aug 31, 2008
Messages
136
Reaction score
1
rme2011030603104049.png


A Player Is To Stand On The Tile And Pull The Switch If They Have Any Of The Gems It Will Remove Them From The Player And Put The Gems In The Crate And Give The Player The GP In Exchange For The Amount Of Gems They Have :huh: Yea I Know Its Confusing But If Some One Can Help I would Be Extremely :) Happy
 
The clientside limit is 36, players won't see any items after the 36th. Even though you can make it higher than 36, it's not a good solution.
 
LUA:
local crate = {x=100, y=100, z=7}
local t = {
	[2147] = 100, [2153] = 100,
	[2146] = 100, [2154] = 100,
	[2149] = 100, [2155] = 100,
	[2150] = 100, [2156] = 100,
	[2145] = 100, [2158] = 100
}

function onUse(cid, item, k, itemEx, toPosition)
	k.y = k.y + 1
	if doComparePositions(k, getThingPos(cid)) then
		local it, money = getTileItemById(crate, 1739).uid, 0
		if it == 0 then
			return doPlayerSendCancel(cid, 'Sorry, not possible.')
		end
		for k, v in pairs(t) do
			local n = math.min(100, getPlayerItemCount(cid, k))
			while n ~= 0 do
				doPlayerRemoveItem(cid, k, n)
				doAddContainerItem(it, k, n)
				money = money + n * v
				n = math.min(100, getPlayerItemCount(cid, k))
			end
		end
		if money == 0 then
			doCreatureSay(cid, 'You don\'t have any gems.', TALKTYPE_ORANGE_1, false, cid)
		else
			doPlayerAddMoney(cid, money)
			doCreatureSay(cid, 'You sold the gems for ' .. money .. ' gold.', TALKTYPE_ORANGE_1, false, cid)
		end
	else
		doCreatureSay(cid, 'You must stand on the switch tile.', TALKTYPE_ORANGE_1, false, cid)
	end
	return true
end
 
Back
Top