Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

OnClose Event not working?

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

✓ Accepted answer

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.

1 comment

0

Thanks

This discussion is preserved as it was. New answers, comments, and votes are closed.