try this
local cfg = {
time = 15, -- Time the teleport is open.
exhausted = 60, -- Time you are exhausted.
storage = 1337, -- Storage used for "exhaust."
to = { x = 100, y = 100, z = 7 } -- Where the teleport takes you.
}
function onUse(cid, item, fromPosition, itemEx, toPosition)...