Soft Shutdown Script

Ever wanted to restart all servers in your game without losing a bunch of players? I’ve written a script that does this. It works by hooking into game:BindToClose() and teleporting all players into a reserved server, which basically serves as a lobby. When a server spawns up, if it’s a reserved server (and not a VIP server), it will automatically wait a few seconds and then teleport players back into the main place.

Note that if you don’t wait before teleporting everyone back into the main game, the game will tend to match-make each player into their own server, which is why I added some wait() statements in between teleporting each player.

I’ve only tested this on small games (300 players, 10 servers) but I am curious how well it works on larger games. Please make pull requests if you figure out any improvements.

Script source:

Advanced Shutdown Script
Best method of shutting down a game
How do you shutdown without having players go back and press play?
Game Development Resources [MEGA THREAD]
Allow us to phase out old servers by preventing new players from joining
Creating Live Updates
Force-reboot a server
[New softshutdown system]
Is it possible to make a gui that pops up when I click the shutdown all servers button and it teleports everybody playing into a new server?
Server shutdowns triggered by a proxy server using HTTPService - is this a bad idea?
Is there any other way to improve my DataStore more?
Soft Shutdown Support
Soft Shutdown 1.5v
Uniform server version number in configure place
"Migrate to Latest Update" shuts down ALL servers
How do I restart the server and make all players reconnect?
What is the best way to update your games?
Teleport players on update
Introducing Migrate to Latest Update
Random server shutdown
Teleport all players to a new server when the game is updated?
LoadAsset() Update?
Possible to present reconnect as an option for kicks?
Is there any way to still show a gui when BindToClose?
Shutdown Message Warning On Update?
Is it possible to make a manual global shutdown system?
[Open Source] Custom queue
Can't join games after shutdown
Introducing Migrate to Latest Update
Auto update feature, don't know where to start
Updating Server Without Shutting It Down
Shutdown script not working!
How should I be using BindToClose()?
Smooth Shutdowns - Update your game servers with ease
Do I kick people from servers when I update?
Soft Shutdown Not Working
Automatic/Artificial Shutdown Script
Shutting the server down problem
How to make a good anti-exploit?
Question About Game Shutdown
Question about API/HTTP service
Onwar Shutdown | Shutdown Gui/Screen [POLL]
How to make a game version checker

Thank you! I will have to try this out. If only we could link our script sources to github repositories…


This is great! I’ll definitely be using this in the future.


This is the most clever use of reserved servers I have seen. I will definitely try to implement a modified version for Ultimate Boxing (mainly the message).


Thank you so much for this! This’ll be pretty neat if any of my games actually get popular and I need to release an urgent update without losing all of my players!


This is a great use of reserved servers as now I won’t have to worry about loosing players! :grinning::grinning:


I made an identical system a few months back for my game but had to rip it out due to some issues.

The main issue was that no matter how long I waited it seemed some servers would never die fast enough so teleporting back would sometimes end up in old servers or fail attempting to join a dead server. I was doing everything like kicking any pkayers attempting to join etc. But no luck. It was a mess.

Since then teleportService and servers migt have become more reliable and it might be time for me to reimplement but im unsure,

EDIT: Read the code properly and realised it activated when the server was shutdown from the site anyways which is a smart alternative to what I was doing. I’m not sure if this would’ve solved my servers shutting down fast enough issue but it looks like it might have.


That’s the plus side of using reserved servers, no one will accidentally get placed into the ‘lobby’ servers.

Worth noting that there was also a bug that was only recently fixed where game.OnClose would kick out all players before you had the chance to teleport them out.


Cool, I might use this for my game.

1 Like

Already implemented in my game and works like a charm. It’s almost fun for me to shut down servers now, just to watch the servers disappear and return within seconds!


Oh, no what I meant was:

I teleported all the players to reserved servers and let them wait there for a bit, then when I teleported them back sometimes some of the old serverrs would still be alive and they’d end up in those.


This may sound silly but is there a way to shutdown all servers via chat commands? Sometimes im testing a game and i say Shutdown to close a single one since my game isn’t very big.


This is sweet! I will use it later on!


For anyone interested: Just shut down my servers with 1.4k CCU and everything turned out smoothly – only lost about 200 players. Datastores still working smoothly, no data lost. Love this script!


Now implemented and ready for the next Ultimate Boxing update. :grin:


Added to my game, with about 1k concurrent users, 90 servers. Will let you know how it goes.


That’s so simple, yet such a good solution for this. Innovation at its finest :slight_smile:


This sounds incredibly useful, I can’t wait to test it!


Has anyone run into this yet with this model?

I think he was talking about his old system of rebooting servers. Shouldn’t happen with soft shutdown.