SoftShutdown2 — Shutdown all servers with peace of mind!

Hi,

They’re not meant to be teleported to a separate game (universe/experience), but instead a place within the main game.

2 Likes

Nope, I don’t use MessagingService at all for this! Though, I do pass some teleport data (such as the original PlaceId) via TeleportService.

2 Likes

I misspoke; when they are teleported to the SoftShutdown place, they never get sent back to the main place.

3 Likes

This may sound dumb but how exactly do we push this soft shutdown?
Like how do I activate it so it does teleport people to another place.
Thank you in advance!

3 Likes

Sounds good is it possible to add music during the wait and customise the wait time for shutdowns.

1 Like

Update — Version 1.1 is out!

Brief summary of changes:

  • Added the option to reserve the player’s position in the world when teleporting. The goal of this is to make the transition into a new server as seamless as possible for the player. It is an experimental feature, and not all games might suit it. If you don’t need it, make sure that ReserveCharacterPosition is set to false. This should help both the player to have a better experience, and the developer to not lose as much player engagement during this time.
  • Teleport interface had its time removed, and code cleaned up - removing any unnecessary variables, and ditching the tweening for a regular loop - since it’s linear, this would be better.

  • Minor code improvements from task library conversion, replacement of pcall>xpcall, ipairs where possible, and a new MigrationPlaceId variable, which would act as a backup for place teleportation in case if the TeleportData is ever lost.

What changes will I have to make on my end?

Simple! Replace the SoftShutdown2’s source with the new one in each of your places. After that, fill out the StartPlaceId, MigrationPlaceId, and ReserveCharacterPosition variables. The post was updated to reflect the new changes, along with a clearer tutorial for importing it into developer’s experiences. That’s it!

Minor changes were made with the GUI as shown above, but they shouldn’t change anything functionality-wise besides the removal of the time in the top-right corner, so updating it isn’t mandatory and you shouldn’t notice any difference.


As always, feel free to report any issues you encounter, and I’ll get to you as soon as I can! :slight_smile:

8 Likes

xpcall is pcall but the second argument is the error handler function

xpcall(target, errhandler, extraarg1, ...)
--// target = Target function to call under protected mode
--// errhandler = Will be run if protected target function failed to finish execution due to error, it should normally pass the error message to the function ("function errhandler(err: string)")
--// The rest of the arguments are passed to target

In pcall form:

function errhandler(err: string) end
do
    local success, err = pcall(target, extraarg1, ...)
    if not success then errhandler(err) end
end
1 Like

This is pretty useful,
I will be using this for my obby game!

1 Like

Do you think there will ever be a way to have the new servers appear on the server list? When I restart it, the server vanishes off of the server list on the game page and you can’t join your friends or anything like that but it still says there’s players in the game. I’m aware this is because of the ReservedServer, but do you know if there’s any way around this without the use of ReservedServers?

1 Like

The only way I’ve figured out to do it is to avoid reserving a server, and instead teleport them directly to the place - though this isn’t recommended since not all players are likely to stay together.

It would be nice if Roblox allowed us to create a new regular server to fill, but let regular players join shortly after, but as far as I know it’s not possible. If anyone does find a reliable workaround, I’d definitely add it to SoftShutdown2.

2 Likes

That’s what I figured, but that’s mildly annoying.

Is there any way to make a feature request if there hasn’t been one already? I think this kind of addition would be very helpful.

Try using TeleportService:TeleportPartyAsync().

This will let you teleport the server full of people in the migration place to a normal, non-reserved server while keeping them together.

2 Likes

Hey! So I’m having a bit of a problem and I’m not sure if this is just a Roblox thing, but whenever I go to shutdown a server the user is being kicked for “Unexpected client behavior.” I tried finding a solution to this with no success so I’m wondering if anyone else has had this problem and/or has a solution.

Note: Guide was followed correctly. The script is in ServerScriptStorage both in the main place and in the migration place, and the place IDs are set as well.

image

Does this maintain the players in the server? So if you are in a server with player A, B and C when you get put in a new server will you be with A, B and C in your server?

Yes, it reserves a server which should keep all of the same players that were in the old server in the new one as long as their teleport succeeds.

However, the suggestion made above (TeleportPartyAsync) I haven’t tried yet since I’m not sure if it will guarantee all will make it, while allowing new players to join the server - say it tries to teleport them all to an existing server but it could be full, leading members of the party waiting or being kicked because the server is full.

2 Likes

I’m unfortunately not sure what this error means. Is this still occurring?

2 Likes

Yep. This is still occurring. Could this be a Roblox issue? Is it happening in games you have implemented this in as well?

I have this exact problem as well in my game and had it even before I started using the soft shutdown. Players don’t know the server actually shutdown for an update and so they are thinking they’re actually getting kicked for something they did. Did you ever find a fix for this?

1 Like

I have not found a fix yet. Tried using soft shutdowns in other scripts and it all seems to work fine but the issue is only popping up on the game I’m going go be needing it in. If I don’t figure something out I might make just make a separate post going over the issue.

1 Like