local config = {
playerpos = {x = XXX, y = YYY, z = Z}, -- where player has to use the item
topos = {x = xxx, y = yyy, z = z}, -- where portal will tp
createpos = {x = xxx, y = yyy, z = z}, -- where portal will appear
time = 3 * 60 * 1000 -- time until tp is removed, in miliseconds
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getCreaturePosition(cid) == config.playerpos then
doCreateTeleport(1387, config.topos, config.createpos)
addEvent(doRemoveItem, config.time, getThingAtPos(config.createpos)
end
return 1
end