local stairholePos = {x = 200, y = 300, z = 400, stackpos = 0}
local getTileItem = getThingfromPos(stairholePos)
local dirt = 351
local stairHole = 369
local switch = {off = 1945, on = 1946}
function onUse(cid, item, frompos, item2, topos)
if item.itemid == switch.off and ( getTileItem.itemid ~= nil or getTileItem.itemid ~= 0 ) then
doTransformItem(item.uid, switch.on)
doTransformItem(getTileItem.uid, stairHole)
elseif item.itemid == switch.on and getTileItem.itemid == stairHole then
doTransformItem(item.uid, switch.off)
doTransformItem(getTileItem.uid, dirt)
else
doPlayerSendCancel(cid, "Sorry, not possible.")
end
return true
end