• 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!

Lua Raid Daays

Fortera Global

Intermediate OT User
Joined
Nov 20, 2015
Messages
1,180
Solutions
2
Reaction score
117
I'm trying to make a script that runs only on the 20th, can someone help ?

tfs 1.3

like:
Lua:
function onThink(interval, lastExecution)
    local days = 20
    if days[os.date("%w")] then
        if math.random(10) == 2 then
            Game.startRaid("Bubassauro")
        end
    end
   
    return true
end
 
Lua:
if tonumber(os.date("%d")) == 20 then
Hey thanks, this will work 100%? ^^
To not need to open another topic, could you tell me how the interval in globalevents works? I wanted to onThink every 5 hours ..

<globalevent name="ExecuteRaids" interval="50000000" script="others/Raids.lua"/>
 
Yes, it'll execute when it's the 20th each month.
To your question:
It's in milliseconds, 5 hours = 5*60*60*1000 = 18000000.
It's H * M * S * MS, 3 hours = 3 * 60 * 60 * 1000 = 10800000.
 
Back
Top