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

Saw Mill Wood System Help/Request

Blackcody

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


Its For A RPG Server I Need The Script To Give 15 GP For Every Branch Made In To A Board:blink:
 
Code:
	<action uniqueid="10004;10005" event="script" value="belt.lua"/>
	<action itemid="8582" event="script" value="branch.lua"/>
LUA:
local from, to, event =
{x=1019, y=1022, z=7},
{x=1023, y=1022, z=7},
{}

if from.y ~= to.y or from.z ~= to.z or getDirectionTo(from, to) ~= EAST then
	error('Positions are not configured properly.')
end

local function move(i)
	doRelocate({x=from.x+i, y=from.y, z=from.z}, {x=from.x+i+1, y=from.y, z=from.z})
	event[i] = addEvent(move, 1000, i)
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local r = item.itemid == 1945
	if r then
		for i = 0, to.x - from.x - 1 do
			event[i] = addEvent(move, i * 500, i)
		end
	else
		for i = 1, #event do
			stopEvent(event[i])
		end
		event = {}
	end
	doTransformItem(10004, r and 1946 or 1945)
	doTransformItem(10005, r and 1946 or 1945)
end
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if itemEx.itemid >= 1381 and itemEx.itemid <= 1384 then
		doRemoveItem(item.uid)
		doPlayerAddItem(cid, 5901, 1)
		doPlayerAddItem(cid, 2148, 15)
		return true
	end
end
uids 10004 & 10005 on levers.
 
Back
Top