So I was making a script that would save an entire folder value and convert it to a table when a player leaves but when I try to play the game it breaks and doesn't save? Explanation and is there a possible fix to it? (A script that could keep the server up for 1 second or over when a player leaves would be accepted)
✓ ANSWER ACCEPTED
Player removing is not working anymore???
1 answer
✓ Accepted answer
OnClose should do the trick.
-- there's a limit to how long this can yield. Information might be on the wiki, idk
game.OnClose = function()
wait(5)
end
This discussion is preserved as it was. New answers, comments, and votes are closed.

6 comments
horrible answer
/\ ignore that
tf kind of answer is this
@ben20isgoo it works! It can delay the game shutdown time. Very useful
OnClose is deprecated so I was redirected to this page: http://wiki.roblox.com/index.php?title=API:Class/DataModel/BindToClose
Oh, sorry. Yeah, you should use BindToClose then.