Skip to main content

SoftShutdownService

This service lets you shut down servers without losing a bunch of players. When game.OnClose is called, the script teleports everyone in the server into a reserved server.

When the reserved servers start up, they wait a few seconds, and then send everyone back into the main place.

Originally written by Merely https://github.com/MerelyRBLX/ROBLOX-Lua/blob/master/SoftShutdown.lua

Modified by Quenty

Functions

Init

SoftShutdownService:Init(serviceBagServiceBag) → ()

Initialize the service. Should be done via ServiceBag.

warning

Initializing this service effectively initializes side effects, which is, to initialize the soft shutdown behavior.

Show raw api
{
    "functions": [
        {
            "name": "Init",
            "desc": "Initialize the service. Should be done via [ServiceBag].\n\n:::warning\nInitializing this service effectively initializes side effects, which is, to initialize\nthe soft shutdown behavior.\n:::",
            "params": [
                {
                    "name": "serviceBag",
                    "desc": "",
                    "lua_type": "ServiceBag"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 43,
                "path": "src/softshutdown/src/Server/SoftShutdownService.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "SoftShutdownService",
    "desc": "This service lets you shut down servers without losing a bunch of players.\nWhen game.OnClose is called, the script teleports everyone in the server\ninto a reserved server.\n\nWhen the reserved servers start up, they wait a few seconds, and then\nsend everyone back into the main place.\n\nOriginally written by Merely\nhttps://github.com/MerelyRBLX/ROBLOX-Lua/blob/master/SoftShutdown.lua\n\nModified by Quenty",
    "source": {
        "line": 16,
        "path": "src/softshutdown/src/Server/SoftShutdownService.lua"
    }
}