• 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 Server Saving on tfs 1.2 [10.98]

XiolenceOT

New Member
Joined
Jun 5, 2023
Messages
42
Reaction score
4
I've tried searching on otland, but I'm having issues finding one that works with the command to server save, and the server doesn't save unless it's the very end of the day on my hosting machine, I'd like to have it save every hour, or 30 minutes if possible and have a command to start a save if possible at all.
 
\data\scripts\globalevent\save.lua

Lua:
local autoSave = GlobalEvent("autoSave")
local cleanMapAtSave = true
local function serverSave(interval)
    if cleanMapAtSave then
        cleanMap()
    end
    saveServer()
    Game.broadcastMessage('Server save complete. Next save in ' .. math.floor(interval / 60000) .. ' minutes!', MESSAGE_STATUS_WARNING)
end
function autoSave.onThink(interval)
    Game.broadcastMessage('Server save in 60 seconds. You might lag or freeze for 3 seconds.', MESSAGE_STATUS_WARNING)
    addEvent(serverSave, 60000, interval)
    return true
end
autoSave:interval(1800000)
autoSave:register()
--credits ? I don't remember
 
I've tried searching on otland, but I'm having issues finding one that works with the command to server save, and the server doesn't save unless it's the very end of the day on my hosting machine, I'd like to have it save every hour, or 30 minutes if possible and have a command to start a save if possible at all.

Why do u use tfs 1.2
 
Back
Top