SoftShutdown2 — Shutdown all servers with peace of mind!

very useful for my game , I am going to bookmark it.

1 Like

So do I put the main games ID into the SoftShutdown script in the softshutdown place

1 Like

Hey,

The variable SoftShutdownPlace will be for your empty migration place’s PlaceId. Regardless of what place this script is in, it will always be the same.

4 Likes

let me guess, messagingservice isn’t it

1 Like

How can I modify it to make it place players back into a normal server after they are teleported to the shutdown place?

1 Like

Not possible at the moment. In order for this to be possible, we need a way to guarantee new servers without using reserved servers :

4 Likes

So basically this script doesnt get players back into new updated server is what your saying?

If this script runs, then it teleports players to the reserved empty place, then teleports then back into old servers that are not updated yet?

1 Like

Correct, it’s not guaranteed to place players into a new server with the way the API works at the moment.

2 Likes

Is there any way to do it though? like why not just teleport them directly into a reserved server and let them stay there? Wont that reserved server be an updated version of the game? Sure people wont be able to join them but maybe this is our best solution right now?

1 Like

As mentioned in my feature request thread, that is the only way to guarantee new servers. You are correct that new players cannot join, this will cause the server to die out as time goes on which isn’t ideal.

1 Like

When using this, Players in the SoftShutdown game are never teleported back to the main game.

2 Likes

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