Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

OnClose Event not working?

Asked by
Valatos 166
8 years ago

I tried to use the OnClose event, but it doesn't seem to work in game

game.OnClose = function()
    print("Closing")
    wait(3)
    print("Shutting down")
end

1 answer

Log in to vote
2
Answered by
M39a9am3R 3210 Moderation Voter Community Moderator
8 years ago

game.OnClose is a callback, it is intended to help game developers have the ability to save game data before a server is to shut down. The maximum wait time before a the game is forced to shutdown is 30 seconds. To trigger the callback, all players would have to leave the game or you have to send a shutdown signal to the game via the website. This just lets game owners have a few more seconds to save information to DataStores and send final requests to HttpServices and other necessary actions for the game.

0
Thanks Valatos 166 — 7y
Ad

Answer this question