local config = {
wait = 30 -- TEMPO DE EXECUÇÃO DO TELEPORTE; EM SEGUNDOS
position = {x = 1, y = 1, z = 7} -- POSIÇÃO DE TELEPORTE
events = {}
}
function teleportEvent(cid, seconds)
if not isCreature(cid) then
config.events[cid] = nil
return true
end
seconds = seconds - 1
if seconds == 0 then
doTeleportThing(cid, config.position)
config.events[cid] = nil
else
config.events[cid] = addEvent(teleportEvent, 1 * 1000, cid, (seconds - 1))
end
end
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Contagem iniciada. Você será teleportado em ".. config.wait .." segundos.")
config.events[cid] = addEvent(teleportEvent, 1 * 1000, cid, config.wait)
return true
end
function onStepOut(cid, item, position, lastPosition, fromPosition, toPosition, actor)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Não saia do piso!\nContagem zerada.")
stopEvent(config.events[cid])
config.events[cid] = nil
return true
end
Fiz de cabeça, talvez não funcione. Faça um teste e me avise.