Is there any problem with that script?
save.lua
When server crash the players lose some items and go back to other position.
Always with that script the save time is 0 seconds.
And now I tried command /save and it spend 0.917 seconds.
Maybe something is wrong and that's why always says 0 seconds?
save.lua
Lua:
local config = {
broadcast = {120, 30},
shallow = "no",
delay = 120,
events = 30
}
config.shallow = getBooleanFromString(config.shallow)
local function executeSave(seconds)
if(isInArray(config.broadcast, seconds)) then
local text = ""
if(not config.shallow) then
text = "Full s"
else
text = "S"
end
text = text .. "erver save within " .. seconds .. " seconds, please mind it may freeze!"
doBroadcastMessage(text)
end
if(seconds > 0) then
addEvent(executeSave, config.events * 1000, seconds - config.events)
else
doSaveServer(config.shallow)
end
end
function onThink(interval)
if(table.maxn(config.broadcast) == 0) then
doSaveServer(config.shallow)
else
executeSave(config.delay)
end
return true
end
XML:
<globalevent name="save" interval="900000" event="script" value="save.lua"/>
When server crash the players lose some items and go back to other position.
Always with that script the save time is 0 seconds.
And now I tried command /save and it spend 0.917 seconds.
Maybe something is wrong and that's why always says 0 seconds?