Globalevent:
function onThink(interval, lastExecution, thinkInterval)
local time = 30 * 60 * 1000
doCreateTeleport(1387, {x=664, y=577, z=12}, {x=162, y=40, z=7})
doBroadcastMessage("O portal do evento da vip5 'gratis' foi aberto ele durara 30 minutos.")
setGlobalStorageValue(21973, os.time()+time)
addEvent(doFinishEvent, time, {x=162, y=40, z=7})
end
function doFinishEvent(pos)
doBroadcastMessage("O portal do evento foi fechado. Próximo evento em 3 horas.")
doRemoveItem(getTileItemById(pos, 1387).uid, 1)
doSendMagicEffect(positioni, CONST_ME_POFF)
end
Talkaction:
function onSay(cid, words, param) local time, startTime, timeToOpen = 30 * 60 * 1000, getGlobalStorageValue(21973)-time, (startTime + 3 * 60 * 60 * 1000) - os.time() if os.time() >= getGlobalStorage(21973) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "O portal já está fechado. Um novo evento acontecerá em ".. timeToOpen .." segundos.") else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "O portal do evento se fechará em: "..getGlobalStorage(21973) - os.time().." segundos.") end return true end




info
Grupo: Campones
Registrado: 20/11/11
Posts: 22
Reputação: +2
Char no Tibia: Druid Eclypse
bom tenhu um script(nao foi eu quem fiz creditos de amoeba13 ta aki o link http://www.xtibia.com/forum/topic/150606-criar-um-evento-com-teleport/)e queria que quando o player falasse 1 comando aparecese quanto tempo falta para o teleport abrir,ta aki o script
local positioni = {x=162, y=40, z=7}
function onThink(interval, lastExecution, thinkInterval)
local time = 30000
doCreateTeleport(1387, {x=664, y=577, z=12}, positioni)
doBroadcastMessage("O portal do evento da vip5 'gratis' foi aberto ele durara 30 minutos.")
addEvent(deleteTp, time*60)
addEvent(doBroadcastMessage, time*100*60, "O portal do evento foi fexado. Próximo evento em 3 horas.")
end
function deleteTp()
local delete = getTileItemById(positioni, 1387)
doRemoveItem(delete.uid, 1)
doSendMagicEffect(positioni, CONST_ME_TELEPORT)
end
e a tag esta ake
<globalevent name="evento" interval="3800" event="script" value="evento1.lua"/>
revisano quando o player falasse
!tempoeve --aparece quanto tempo falta para o teleport abrir
vlw
rep+ se conseguir