PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience
Collapse Sidebar

OnClose

DataModel

Tuple

Invoked before the game is shut down. When this callback returns, or the timeout period is hit, the game finishes shutting down.

Expected Return Type

Return Type Summary

Code Samples


DataModel.OnClose1

The example below would print “Closing, waiting” to the output. It would wait three seconds and then print “Done”. At this point Roblox will be able to shut down the server.

game.OnClose = function()
	print 'Closing, waiting'
	wait(3)
	print 'Done'
end