local cd = {
cdtime = 30, --//-- quanto tempo fica sem usar o item
str = 65545, --- não mexa
pos = {x = 81, y = 339, z = 7}, --- pos para onde o player vai
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid, cd.str) < os.time() and not getCreatureCondition(cid, CONDITION_INFIGHT) then
setPlayerStorageValue(cid, cd.str, os.time() + cd.cdtime)
doPlayerSendTextMessage(cid, 19, "Voce foi transportado de volta a File City") -- mensagem que sairá quando ele for teleportado
doTeleportThing(cid, cd.pos)
doSendMagicEffect(getThingPos(cid), 10)
doRemoveItem(item.uid, 1)
elseif getPlayerStorageValue(cid, cd.str) >= os.time() then
doPlayerSendTextMessage(cid, 19, "Espera para usar novamente")
else
doPlayerSendTextMessage(cid, 19,"Impossivel usar esse item em batalhas!")
doSendMagicEffect(getThingPos(cid), 2)
end
return true
end