Skip to main content

ResetServiceClient

This item only works when running on the client. Client

Handles reset requests since Roblox's reset system doesn't handle ragdolls correctly.

Automatically sets itself ot the ResetButtonCallback upon initialization.

The reset button may be disabled by pushing onto the disable stack.

local cancel = resetServiceClient:PushDisable()
-- ... reset button is hidden ...
cancel()

Functions

Init

ResetServiceClient.Init(
serviceBagServiceBag
) → ()

Initializes the reset service. Should be done via a ServiceBag.

PushDisable

ResetServiceClient.PushDisable(selfResetServiceClient) → function--

Function to cancel the disable

Pushes a disable state onto the reset service, which removes the reset button for the local player for as long as the state is held.

IsDisabled

ResetServiceClient.IsDisabled(selfResetServiceClient) → boolean

Returns whether the reset button is currently disabled

ObserveIsDisabled

ResetServiceClient.ObserveIsDisabled(selfResetServiceClient) → Observable<boolean>

Observes whether the reset button is currently disabled

RequestResetCharacter

ResetServiceClient.RequestResetCharacter(selfResetServiceClient) → Promise

Requests the player's character resets

PromiseResetCharacter

ResetServiceClient.PromiseResetCharacter(selfResetServiceClient) → Promise

Kills the local character and requests the server reset it

Show raw api
{
    "functions": [
        {
            "name": "Init",
            "desc": "Initializes the reset service. Should be done via a [ServiceBag].",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "ResetServiceClient"
                },
                {
                    "name": "serviceBag",
                    "desc": "",
                    "lua_type": "ServiceBag"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 56,
                "path": "src/resetservice/src/Client/ResetServiceClient.lua"
            }
        },
        {
            "name": "PushDisable",
            "desc": "Pushes a disable state onto the reset service, which removes the reset button\nfor the local player for as long as the state is held.",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "ResetServiceClient"
                }
            ],
            "returns": [
                {
                    "desc": "Function to cancel the disable",
                    "lua_type": "function"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 82,
                "path": "src/resetservice/src/Client/ResetServiceClient.lua"
            }
        },
        {
            "name": "IsDisabled",
            "desc": "Returns whether the reset button is currently disabled",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "ResetServiceClient"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 93,
                "path": "src/resetservice/src/Client/ResetServiceClient.lua"
            }
        },
        {
            "name": "ObserveIsDisabled",
            "desc": "Observes whether the reset button is currently disabled",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "ResetServiceClient"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Observable<boolean>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 104,
                "path": "src/resetservice/src/Client/ResetServiceClient.lua"
            }
        },
        {
            "name": "RequestResetCharacter",
            "desc": "Requests the player's character resets",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "ResetServiceClient"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 131,
                "path": "src/resetservice/src/Client/ResetServiceClient.lua"
            }
        },
        {
            "name": "PromiseResetCharacter",
            "desc": "Kills the local character and requests the server reset it",
            "params": [
                {
                    "name": "self",
                    "desc": "",
                    "lua_type": "ResetServiceClient"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 140,
                "path": "src/resetservice/src/Client/ResetServiceClient.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "ResetServiceClient",
    "desc": "Handles reset requests since Roblox's reset system doesn't handle ragdolls correctly.\n\nAutomatically sets itself ot the ResetButtonCallback upon initialization.\n\nThe reset button may be disabled by pushing onto the disable stack.\n\n```lua\nlocal cancel = resetServiceClient:PushDisable()\n-- ... reset button is hidden ...\ncancel()\n```",
    "realm": [
        "Client"
    ],
    "source": {
        "line": 18,
        "path": "src/resetservice/src/Client/ResetServiceClient.lua"
    }
}