data/talkactions/scripts
local teleport_time, exhaust = 10, 20 --Respectivamente, tempo para teleportar e cooldown.
function channel_teleport(cid, time)
if not isPlayer(cid) then
return true
elseif getCreatureCondition(cid, CONDITION_INFIGHT) then
doPlayerSendCancel(cid, "You can't teleport while in battle.")
return true
elseif time <= 0 then
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
setPlayerStorageValue(cid, 2910, os.time() + exhaust * 60)
return true
end
doPlayerSendTextMessage(cid, 27, time)
addEvent(channel_teleport, 1000, cid, time - 1)
end
function onSay(cid)
if getPlayerStorageValue(cid, 2910) > os.time() then
doPlayerSendCancel(cid, "This command is still in cooldown. Wait "..(getPlayerStorageValue(cid, 2910) - os.time()).." seconds to use it again.")
return true
elseif getCreatureCondition(cid, CONDITION_INFIGHT) then
doPlayerSendCancel(cid, "You can't use this command in battle.")
return true
end
channel_teleport(cid, teleport_time)
return true
end
<talkaction words="!cp" event="script" value="nome_do_arquivo.lua"/>










info
Grupo: Campones
Registrado: 19/11/15
Posts: 8
Reputação: 0
Olá, é possível criar um comando !cp que após o player digitar isso ele seja teleportado para sua town city (seu cp) porém mostrando 10, 9, 8, .. 3,2,1 e aí sim ocorrer o teleport?
Em outras palavras, adicionar um delay mostrando no default o tempo para ser teleportado...
Seria genial para mim;
Utilizei o mesmo /t que o god tem porem coloquei acess: 0 para os players tb usarem... Só que assim se o player tiver morrendo fica facil correr, facilitando demais.
Então pretendo dar um delay no teleport !cp ou só deixar usar quando tiver sem PZ .. pode ser um script assim porem que só funcione sem battle