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

Solved Raids with day and hour. [TFS 1.3]

Wanheda

New Member
Joined
Feb 17, 2016
Messages
44
Solutions
2
Reaction score
4
I have this script that is in globalevents, that was to give invasion with date and time, but it is not working. I tried to change some script in the raids folder, but it still did not work.
PHP:
local raids = {
    -- Weekly
    ['Monday'] = {
        ['08:00'] = {raidName = 'RatsThais'},

        ['21:00'] = {raidName = 'Arachir the Ancient One'}
    }
}

function onThink(interval, lastExecution, thinkInterval)
    local day, date = os.date('%A'), getRealDate()

    local raidDays = {}
    if raids[day] then
        raidDays[#raidDays + 1] = raids[day]
    end
    if raids[date] then
        raidDays[#raidDays + 1] = raids[date]
    end

    if #raidDays == 0 then
        return true
    end

    for i = 1, #raidDays do
        local settings = raidDays[i][getRealTime()]
        if settings and not settings.alreadyExecuted then
            Game.startRaid(settings.raidName)
            settings.alreadyExecuted = true
        end
    end

    return true
end

Can someone help me?
something is missing? Do I have to configure anything else?
 
Solution
I discovered why it did not work, it was missing a line in globalevents.xml

PHP:
<globalevent name="RaidSystem" interval="10000" script="spawn/raids.lua"/>


Anyway, Thank you for listening.
I discovered why it did not work, it was missing a line in globalevents.xml

PHP:
<globalevent name="RaidSystem" interval="10000" script="spawn/raids.lua"/>


Anyway, Thank you for listening.
 
Solution
Back
Top