Just wondering what would be the easiest way to make a soft shutdown script without using game:BindToClose()? I’m trying to make it give approx. 5-7 minutes for players to save until they all get kicked. However, BindToClose() only gives 30 seconds, and only saves some data and kicking them asap. I saw Merely’s example, but that also uses BindToClose().
A great example of what I’m trying to achieve is similar to the shutdown GUI that was in Pokemon Brick Bronze, where it shows a timer, and warns the player that the game is shutting down shortly.
You can’t. BindToClose and Close have an enforced 30-second frame before the server closes. That’s the closest you’re getting to a function that’ll continue to run and stall the full closure of servers post-shutdown. BindToClose is the easiest way; you can’t go simpler than that.
If you want to achieve a “game shutting down soon” message, you can use the InsertService to get the latest asset version (pass the PlaceId in as the AssetId parameter). Get your functionality done within that window, then shut the game down (i.e. kicking all joining and new players). It’s not a soft shutdown script but it’s another alternative.
Is this for updating the servers to a new version?
Could you use Http service to check if the servers requires a shutdown, then implement your own soft shutdown notifying all users that the server requires a restart?
I’ve already made a pretty good version, which uses the name of a model that changes, and then forces the shutdown. It’s not as difficult as many people think it is.