Hello!
So, I’m wondering if there is option to show a gui when game:BindToClose?
Basically, I want to create shutdown system which teleports players to another place, and that gui would be displayed. But I don’t know how to do that on game bind to close.
It just disappears if I do it.
Hi so from the looks of it your trying to make your own version of a Soft Shutdown, Merely has an open sourced version and I think it is basically what you are looking for and you edit it to fit your needs!
EDIT: Actually, even the soft shutodown should work, the wiki says “The game will wait a maximum of 30 seconds for all bound functions to complete running before shutting down. After 30 seconds, the game will shut down regardless if all bound functions have completed or not.”
I’ll do a bit further testing brb.
Sorry about necroposting, but I found the problem. Apparently, when DataStore2 does BindToClose it parents the player to nil, thus causing the player removing event to be triggered, which then prevents the soft shutdown script to not teleport the players. @Kampfkarren any solution to this?
Again sorry for the necropost, but I found a solution to this.
Search all scripts for “.parent = nil” go to the one from the Datastore2 script and comment/remove it. Then set up your own .BindToClose function in your saving script, and save everything. Then you can also have UI show up.