--config--
local positions = { -- the positions of each lever
[{x=x, y=y, z=z, stackpos=1}] = 1946,
[{x=x, y=y, z=z, stackpos=1}] = 1946,
[{x=x, y=y, z=z, stackpos=1}] = 1946,
[{x=x, y=y, z=z, stackpos=1}] = 1946
}
--config--
function onUse(cid, item, frompos, item2, topos)
doTransformLever(item)
for position, itemid in pairs(positions) do
if (getThingfromPos(position).itemid ~= itemid) then
-- some lever is not the required itemid, do something or just return 1?
return 1
end
end
-- all levers are the correct itemid
return 1
end
function doTransformLever(lever)
lever.itemid = lever.itemid == 1945 and 1946 or 1945
doTransformItem(lever.uid, lever.itemid)
return lever.itemid
end