needing this in order to save automatically on my rpg private server
Forum
![>](img/i_next.png)
![>](img/icons/cs2d.png)
![>](img/i_next.png)
![>](img/i_next.png)
Autosay every any minutes
5 replies![To the start](img/i_first.png)
![Previous](img/i_prev.png)
![Next](img/i_next.png)
![To the start](img/i_last.png)
needing this in order to save automatically on my rpg private server
![cs2d lua cmd](img/i_codehelp.png)
on the help site are some examples that should help you
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
if sample==nil then sample={} end sample.ads={} addhook("minute","sample.ads.minute") function sample.ads.minute() 	msg("This script was stolen from") 	msg("=> sys/lua/samples/advertise.lua") end
Stolen from sys/lua/samples/advertise.lua
![√](img/ok.gif)
1
2
3
4
2
3
4
timer(120000,'Hello','',0) function Hello() msg('\169000255000Hello Everyone!.') end
![user](img/i_friend.png)
needing this in order to save automatically on my rpg private server
I am guessing that you are talking about "Tibia" based on your comment from another thread.
Tibia actually has an auto-saves which saves every 5 minutes (minute hook) depending if your server has a password or not, which you can remove and change the timer to whatever you want.
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
--Change this line; remove game'sv_password' == '' and change the 5 to whatever timer you want. --If you want it to save every minute, you can remove the whole if-statement --hooks.lua ; minute-hook if game'sv_password' == '' and MINUTES%5 == 0 then --You could print out a message to the console or to the players --to let them know that the server has been saved --msg("Server saved!") 	saveserver() end
Quoted from
![thread](img/i_forum.png)
![cs2d](img/icons/cs2d.png)
![user](img/i_friend.png)
this is my problem in my own tibia private server too..
its not saving while quitting the server or closes it
its not saving while quitting the server or closes it
To make it save when you shutdown your server or when you change map, you just need to add the hooks:
![cs2d lua hook](img/i_codehelp.png)
![cs2d lua hook](img/i_codehelp.png)
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
addhook("shutdown", "EXPshutdown") function EXPshutdown() 	saveserver() end addhook("mapchange", "EXPmapchange") function EXPmapchange() 	saveserver() end
![user](img/i_friend.png)
@
![user](img/i_friend.png)
![](img/smiles/bigsmile.gif)
![user](img/i_friend.png)
@
![user](img/i_friend.png)
@
![user](img/i_friend.png)
![To the start](img/i_first.png)
![Previous](img/i_prev.png)
![Next](img/i_next.png)
![To the start](img/i_last.png)