local config = { minlvl = 50, maxlvl = 100 }
function onUse(cid, item, frompos, item2, topos)
local pos = getPlayerPosition(cid)
local lvl = getPlayerLevel(cid)
if item.uid == 54321 then
if lvl >= config.minlvl and lvl <= config.maxlvl then
if pos.x == topos.x then
if pos.y < topos.y then
pos.y = topos.y + 1
else
pos.y = topos.y - 1
end
elseif pos.y == topos.y then
if pos.x < topos.x then
pos.x = topos.x + 1
else
pos.x = topos.x - 1
end
else
doPlayerSendTextMessage(cid,22,'Stand front of the door.')
return TRUE
end
doTeleportThing(cid,pos)
doSendMagicEffect(topos,12)
else
doPlayerSendTextMessage(cid,22,'You need blablabla...')
end
return TRUE
else
return FALSE
end
end