era isso que eu tava falando..
local toPos = {x = 1596, y = 738, z = 7}
local tempo = 3
local cooldown = 40
function onCastSpell(cid, var)
if getPlayerStorageValue(cid, 2938) > os.time() then
return doPlayerSendCancel(cid, "Aguarde "..getPlayerStorageValue(cid, 2938) - os.time().." segundos para usar esse jutsu novamente.")
end
local pos = getPlayerPosition(cid)
doSendMagicEffect(pos, 20)
setPlayerStorageValue(cid, 2938, os.time() + exhaust)
setPlayerStorageValue(cid, 28101, pos.x) -- salva x
setPlayerStorageValue(cid, 28102, pos.y) -- salva y
setPlayerStorageValue(cid, 28103, pos.z) -- salva z
doTeleportThing(cid, toPos, false) -- teleporta nova pos
addEvent(function()
if isCreature(cid) then
doSendMagicEffect(pos, 20)
doTeleportThing(cid, {x = getPlayerStorageValue(cid, 28101), y = getPlayerStorageValue(cid, 28102), z= getPlayerStorageValue(cid, 28103)}, false)
end
end, tempo * 1000)
return true
end