Fala galera, tranquilos? gostaria de saber se alguem poderia me ajuda com isso... gostaria que assim que anunciar quantos minutos faltam para começar o evento, surgisse um efeito /x 55 e dps o /x 56.
Segue a imagem a baixo:
Fala brow! Vamos lá!
Vai na pasta do servidor, em globalevents/scripts
Cria um arquivo .lua com o nome MensagensProgramadas e dentro deste arquivo cole isso:
local msg = {
['21:00'] = {text = '[Fire Storm] Texto que você quiser.', type = 21},
['08:55'] = {text = 'Textinho maroto', type = 21},
['22:59'] = {text = 'Só texto massa, vc eh fera', type = 21},
}
function onThink(interval, lastExecution)
local h = msg[os.date('%X'):sub(1, 5)]
return h and doBroadcastMessage(h.text, h.type) or true
end
Nos locais onde está escrito 'texto' você faz seu anúncio.
Onde tem os exemplos "21:00, 08:55 e 22:59" você modifica para o horário que você quer que a mensagem apareça no seu servidor.
--------------------
Para que o script funcione, você terá que ir na pasta GlobalEvents do seu servidor, e adcionará a seguinte string:
<globalevent name="MensagensProgramadas" interval="29000" event="script" value="MensagensProgramadas.lua"/>
Espero ter ajudado, forte abraço.
-------------------------------
@Edit
Não tinha percebido que só queria o efeito, podes tentar esse outro script aqui, mas não foi feito por mim kkj
local cf = {
teleportPosition = {x = 42, y = 146, z = 7, stackpos = 1}, -- Onde o teleporte será criado
teleportToPosition = {x = 2194, y = 2049, z = 7}, -- Onde o teleporte te leva
from = {x=2172,y=2042,z=7}, -- Diagonal esquerda pra cima da sala do evento
to = {x=2217,y=2062,z=7} -- Diagonal direita pra baixo da sala do evento
}
function onTime ()
doItemSetAttribute(doCreateTeleport(1387, cf.teleportToPosition, cf.teleportPosition), "aid", 1747)
doBroadcastMessage("FireStorm event starting in 3 minutes! The teleport will be closed when the event start!", MESSAGE_STATUS_WARNING)
setGlobalStorageValue(17, 0)
addEvent(startEventF, 3 * 60 * 1000)
return true
end
function startEventF ()
doRemoveItem(getTileItemById(cf.teleportPosition, 1387).uid, 1)
if getGlobalStorageValue(17) > 0 then
addEvent(doRepeatCheckFireStorm, 5 * 1000)
doBroadcastMessage("Good luck in the FireStorm event people! The teleport has closed!", MESSAGE_STATUS_WARNING)
else
doBroadcastMessage('FireStorm Event hasn\'t started beacuse there were not enough players.')
end
end
y, x = 1, 1
function doRepeatCheckFireStorm ()
if getGlobalStorageValue(17) > 0 then
local xTable, yTable, playerTable = {}, {}, {}
for x = cf.from.x, cf.to.x do
for y = cf.from.y, cf.to.y do
table.insert(xTable, x)
table.insert(yTable, y)
local n, i = getTileInfo({x=x, y=y, z=cf.to.z}).creatures, 1
if n ~= 0 then
local v = getThingfromPos({x=x, y=y, z=cf.to.z, stackpos=i}).uid
while v ~= 0 do
if isPlayer(v) then
table.insert(playerTable, v)
if n == #playerTable then
break
end
end
i = i + 1
v = getThingfromPos({x=x, y=y, z=cf.to.z, stackpos=i}).uid
end
end
end
end
if #playerTable == 1 then
doCreatureAddHealth(playerTable[1], getCreatureMaxHealth(playerTable[1]) - getCreatureHealth(playerTable[1]))
doCreatureAddMana(playerTable[1], getCreatureMaxMana(playerTable[1]) - getCreatureMana(playerTable[1]))
doTeleportThing(playerTable[1], getTownTemplePosition(getPlayerTown(playerTable[1])), true)
doItemSetAttribute(doPlayerAddItem(playerTable[1], 7371), "name", "trophy " .. getCreatureName(playerTable[1]) .. "! Congratulations! Winner a fire event")
doPlayerAddItem(playerTable[1],9971,50)
doPlayerAddItem(playerTable[1],6527,400)
doBroadcastMessage('FireStorm Event has finished. The winner is ' .. getCreatureName(playerTable[1]) .. '. Congratulations.')
setGlobalStorageValue(17, 0)
x, y = 1, 1
elseif #playerTable > 1 then
for a = 1, y do
local pos = {x=xTable[math.random(#xTable)], y=yTable[math.random(#yTable)], z=7}
for _, player in ipairs(playerTable) do
local pPos = getThingPos(player)
if pPos.x == pos.x and pPos.y == pos.y and pPos.z == pos.z then
doCreatureAddHealth(player, - getCreatureMaxHealth(player))
end
end
doSendDistanceShoot({x = pos.x - math.random(4, 6), y = pos.y - 5, z = pos.z}, pos, CONST_ANI_FIRE)
addEvent(doSendMagicEffect, 150, pos, CONST_ME_HITBYFIRE)
addEvent(doSendMagicEffect, 150, pos, CONST_ME_FIREAREA)
math.random(100,1000)
end
if x == 5 * y then
y = y + 1
end
x = x + 1
else
doBroadcastMessage('No one have won in Fire Storm Event.')
setGlobalStorageValue(17, 0)
x, y = 1, 1
end
addEvent(doRepeatCheckFireStorm, 1000)
end
end
Para adcionar ao global events, fazer a mesma coisa que eu já havia dito acima.
PS: É NECESSÁRIO ALTERAR A POSX E Y PARA ADEQUAR AS DE SEU SERVIDOR.