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

Does TFS has onStartup?

Spoking

Oldschool Developer
Joined
Sep 4, 2007
Messages
434
Reaction score
34
Does TFS has the onStartUp function?

If yes, write the whole line down please.
 
My auto broadcast script, now everytime i start the server i have to log in and say /begin to let it begin.
 
Well its possible to make a script like this using lua readfile and a bat restarter... simply make the script execute whenever someone logs in, and upon running it creates a file with something in it, a "1" for example, and then set the script to only run when said file dosnt exist, and since its created upon running (which occurrs whenever the first player logs in) it wont run more than once.
Then ofcourse, you make a bat restarter for your server, which aside from the line to start the server, also has a line to delete the file created by the script (before actually starting the server).

Thus the following will occur:

1. The sever is started
2. A player logs in, script searches for file (lets call it "scriptblock.txt"), dosnt find it, and runs, doing what it should, and creating the file to block further running.
3. A secondary (and further) player logs in, script dosnt run because the file "scriptblock.txt" exists.
4. You decide to restart the server, you either use the /shutdown command or use task manager to end the proccess.
5. The bat servermanager detects that the server proccess has stopped running, and proceeds to restart it, but before doing that, it deletes the file "scriptblock.txt", thus allowing the ingame script to run again.
6. #1 in this list happens again.


It might be a bit of a roundabout, but it should do what you want it to do, and be fairly easy to implement.
 
There is no this function because its useless. Activate it in global.lua.

/reload actions plx
I use events in global.lua, they will be duplicated... And since global storages does not reset on restart it's not possible to work around this -.-
 
Back
Top