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

Help with map

Carlos9

New Member
Joined
Oct 25, 2009
Messages
962
Reaction score
1
Location
Mexico
Hey can some one tell me what the script is for pulling a lever and opening doors

Ill give Rep++
 
data/actions/scripts/lever.lua
Code:
local walls = {
	{x = 100, y = 100, z = 7},
	{x = 101, y = 100, z = 7},
	{x = 102, y = 100, z = 7},
	{x = 103, y = 100, z = 7},
	{x = 104, y = 100, z = 7}
}
local wallID = 3515

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.itemid == 10029 then
		for _, v in ipairs(walls) do
			doRemoveItem(getTileItemById(v, wallID).uid)
		end
	elseif item.itemid == 10030 then
		for _, v in ipairs(walls) do
			doRelocate(v, {x=v.x, y=v.y+1, z=v.z})
			doCreateItem(wallID, 1, v)
		end
	end
	doTransformItem(item.uid, item.itemid == 10029 and 10030 or 10029)
	return true
end
data/actions/actions.xml
Code:
	<action uniqueid="10000" event="script" value="lever.lua"/>
And then set UniqueID 10000 on the lever in map editor.
 
Back
Top Bottom