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

Is there an alternative of OnClose()?

1 answer

✓ Accepted answer

Putting this into a question so it can be closed.

http://wiki.roblox.com/index.php?title=API:Class/DataModel/BindToClose

game:BindToClose(function()
	--Do stuff
end)

Credit to: M39a9am3R

1 comment

0

Yes, 'game:BindToClose()' is what you are looking for. The problem with OnClose was that it only allowed for a single callback function. BindToClose instead adds a new callback function to a list of functions to be called when the game shuts down.

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