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

Help me fast D:!

Flaxit

FrozenL Player
Joined
May 22, 2009
Messages
179
Reaction score
1
Location
Sweden
Why is my open tibia servers never saving even if i do the /save command... I had alot of players, and now all is gone just because i shuted down the server.. I would be very thank full if someone helped me!
 
In you Globalevents.xml add
<globalevent name="save" interval="7200" event="script" value="save.lua"/>
and then you need a file called save.lua in globalevents\scripts
HTML:
local config = {
	broadcast = "no"
}

config.broadcast = getBooleanFromString(config.broadcast)
local function executeSave(seconds)
	if(seconds == 0) then
		doSaveServer()
		return true
	end

	if(seconds == 120 or seconds == 30) then
		doBroadcastMessage("Full server save within " .. seconds .. " seconds, please stay in safe place!")
	end

	seconds = seconds - 30
	if(seconds >= 0) then
		addEvent(executeSave, 30 * 1000, seconds)
	end
end

function onThink(interval, lastExecution, thinkInterval)
	if(not config.broadcast) then
		doSaveServer()
		return true
	end

	executeSave(120)
	return true
end
 
Back
Top