Soft Shutdown Script

From what I’ve observed, Roblox’s matchmaking won’t put you into a server that is in the process of shutting down.

3 Likes

Wouldn’t illuzive have not encountered the issue if that weren’t the case? He’s not the first person I’ve heard of experiencing that issue, so I don’t think it was specific to his implementation.

1 Like

See his post, he was using reserved servers but not utilizing Roblox’s server shutdown feature.

5 Likes

I’ve used this shutdown script multiple times over the past two weeks on 250+ servers at a time with no issues. The only minor issue I’ve encountered is that upon re-joining the new servers, a small number (1/100) of players will have a couple textures fail to load, probably due to the massive requests for data from the shutdown

1 Like

So… I just had an “oh essward” moment in Ultimate Boxing. Appears I had Free For All terminate after 1 second instead of 2 minutes. Soft shutdown worked for the emergency fix, with all 8 players arriving back in the same server. :ok_hand:

3 Likes

Having this open source is pretty cool, as it allows people (like me) to innovate. With the original implementation, it killed off plans for tournaments in Ultimate Boxing as all reserved servers would kick players out instantly. To solve this, I have the teleporting for the intermediate place done on the client instead of the server. I also include a decent looking screen instead of the deprecated “Message” instance. Everything is also given as one package and reparented to make inserting easier.

32 Likes

:+1: Awesome I will take the model when I get home!

If I have any suggestions or improvements I will let you know.

One idea would be using those new party teleports. :eyes:

3 Likes

https://wiki.roblox.com/index.php?title=Teleporting_Between_Places#Valid_Teleport_Destinations

TeleportService has limits on the places a player can be teleported to. A player can only be teleported between places in the same game or to the Start Place of another game

4 Likes

Definitely a good script! Would be good if we needed to temporarily remove all players to post an update. Then they could be teleported back

It looks like a recent update broke this. Rather than getting teleported, the players are instantly getting disconnected.

4 Likes

Noticed :frowning:

2 Likes

This is tragic. No wonder my concurrents dropped way lower than normal tonight after I updated. Soft shutdown lets us update more frequently without fear of losing players - I think it’s pretty important that the functionality stays around.

Honestly, this would be a nice feature if it were built into Roblox.

10 Likes

I’m using this for my game and it works GREAT, I just want to say thank you @TheNexusAvenger and @Merely for creating this!!

Would removing the VIP server script effect the script?

It doesn’t use VIP servers, it uses Resverved servers. It does this so that it’s guaranteed you’re teleported to a new server - not one that is shutting down - and remain with the same players.

I made a very simple soft shutdown implementation, it lacks an user interface.

Localscript in ReplicatedFirst

local teleportService = game:GetService("TeleportService")

game:GetService("NetworkClient").DescendantRemoving:Connect(function(replicator) --client loses connection
	if replicator:IsA("NetworkReplicator") then
		while true do
			pcall(teleportService.Teleport, teleportService, game.PlaceId)
			wait(1)
		end
	end
end)

When you’re shutting down the server:

Script in ServerScriptStorage

local players = game:GetService("Players")

local function shutdown()
	for _, player in pairs(players:GetPlayers()) do
		player.Parent = nil --triggers shutdown, but don't disconnect players just yet
	end
end
13 Likes

I’ll be using this for my game, I’ve tested it and it’s worked great! Thanks!

This post inspired me to implement my own version of this into Ghost Simulator before we released, but I didn’t know how effective it would truly be. After the game blew up, we needed to put out a fix at some point to fix some rare purchasing errors. We fearfully reset the servers at 3AM with 40,000 players online…and lost virtually no one! Thank you so much for this, man!

Moral of the story: This soft-shutdown system should be as top priority on your development checklist as ProcessReceipt.

18 Likes