• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua Raid Daays

Sigoles

Discord: @sigoles
Joined
Nov 20, 2015
Messages
1,209
Solutions
2
Reaction score
154
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