local lvl = 50
local t = {
{vocations = {1, 2, 3, 4, 5, 6, 7, 8},Pos = {{x=51, y=138, z=6},{x=44, y=174, z=7}},item= {7092,{x=45, y=134, z=6}}}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
             local check = {}
              local items = {}
      for _, k in ipairs(t) do
local x = getTopCreature(k.Pos[1]).uid
               local v = getTileItemById(k.item[2], k.item[1])
if(x == 0 or not isPlayer(x) or getPlayerLevel(x) < lvl or isInArray(k.vocations, getPlayerVocation(x)) == FALSE) then
doPlayerSendCancel(cid, 'You arent in the right position!') return true
elseif v.uid == 0 then
               doPlayerSendCancel(cid, "The item need to be in the right position.") return true end
table.insert(check, x)
table.insert(items, v)
               end
           for k, tid in ipairs(check) do
           doSendMagicEffect(getCreaturePosition(tid), CONST_ME_POFF)
           doTeleportThing(tid, t[k].Pos[2]) 
           doSendMagicEffect(getCreaturePosition(tid), CONST_ME_TELEPORT)
           end
               for _, remove in ipairs(items) do
               doRemoveItem(remove.uid)
           end
       doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
return true
end