I watched a video about OnClose() and I saw that it was deprecated. But, I wonder if ther is a another way of doing the same thing. Can someone please tell me a least one way?
✓ 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.

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