thirteenth 4 Posted November 19 Hi. An Events.OnGameStart event is exist to enter the game, but I can not find the event responsible for exiting the game. There is an Events.OnDisconnect event, but for me it does not work - the function added to it is never called. I searched the Internet and found a 2016 post on the forum https://theindiestone.com/forums/index.php?/topic/17846-testing-for-when-the-game-is-running-lua/&tab=comments#comment-220050 which mentions the Event.OnGameExit event, but, as far as I understand, this event does not exist. Now I’m thinking about redefining clicking on the Quit menu item, but this will not give me the full necessary result, since it’s still not clear how to handle closing the game console, ALT + F4 or losing the connection. I probably need to look towards the server side of the mod, but I have run out of ideas where and what to look for. I will be grateful if someone shares their knowledge in this area. Quote Share this post Link to post Share on other sites
ZombiesLoveBrainiacs 88 Posted November 20 I haven't used it yet, but maybe "OnSave" will be useful? Is Events.OnDisconnect never dispatched, not even in multiplayer? Quote Share this post Link to post Share on other sites
thirteenth 4 Posted November 21 I apologize for the pause in the reply. I know the OnSave event, but I did not consider it. I'll see if it suits me. Events.OnDisconnect is called when connecting to the server. If a break occurs at the time of the connection, then it is called. After a successful connection, it is no longer called, as far as I understand. Quote Share this post Link to post Share on other sites