• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Globalevent

Untrax

Banned User
Joined
May 29, 2012
Messages
24
Reaction score
0
Hi all right with you?
Guys, so I'm trying to make this automatic event, it is usually only has one detail:
I would like:
When missing 5 minutes it had to happen the event, send one msg:
The event will start in 4 minutes, stay tuned!
The event will start in 3 minutes, stay tuned!
The event will start at 2minutes stay tuned!
Missing one minute:
The event will begin at 1 minute, stay tuned!
After 1 minute, it will make the check:
if #players <2 Then
broadcastMessage return ("The Event may not start. They missed players.")
end

and the amount of players is greater than 2, it starts normally.

Code:
function onThink(interval)
if days[os.date("%A")] then
hours = tostring(os.date("%X")):sub(1, 5)
tb = days[os.date("%A")][hours]
if tb then
local players = {}
    for i = 1, #t do
        local v = getTopCreature(t[i]).uid
        players[i] = isPlayer(v) and v or nil
    end
   
if #players < 2 then
        return broadcastMessage("The Event may not start. They missed players.")
end
local first = players[1] and 1 or players[2] and 2 or players[3] and 3 or players[4] and 4
    for i = 1, 4 do
        if players[i] then
            setPlayerStorageValue(players[i], storage.placed, 0)
            setPlayerStorageValue(players[i], storage.max, 1)
            setPlayerStorageValue(players[i], storage.radius, 1)
            doSendMagicEffect(t[i], CONST_ME_TELEPORT)
            doTeleportThing(players[i], n[i])
            doChangeSpeed(cid, 350)
            doSendMagicEffect(n[i], CONST_ME_TELEPORT)
        end
    end
broadcastMessage("The event has started.")
end
end
return true
end
 
You can use the script I gave to you and make it. Install it on your server and study how it works. I think you can puzzle that.
I tried but the settings are different ... and everything in lib, my already and direct the script .. and I end up messing everything :(
 
You take what you currently have and make a function out of it, e.g executeEvent
Then you set-up a fixed ammount of broadcasts using addEvent.
 
Back
Top