Skip to main content

CoreGuiUtils

Utility functions to work with the CoreGui

Functions

promiseRetrySetCore

CoreGuiUtils.promiseRetrySetCore(
triesnumber,
initialWaitTimenumber,
...any--

parameters to set core with

) → Promise<()>

Retries setting the core. This is required because sometimes the Core scripts are not initialized by the time that client code executes.

promiseRetryGetCore

CoreGuiUtils.promiseRetryGetCore(
triesnumber,
initialWaitTimenumber,
coreNamestring--

Name of the core to get

) → Promise<any>

Retries getting the core. Like CoreGuiUtils.promiseRetrySetCore, this is required because the Core scripts are not necessarily initialized by the time that client code executes.

tryToSetCore

CoreGuiUtils.tryToSetCore(
...any--

Args to try to call SetCore with

) → (
boolean,--

false if failed

string?--

Error, if there was one

)

Tries to invoke StarterGui:SetCore with the arguments specified

tryToGetCore

CoreGuiUtils.tryToGetCore(
coreNamestring--

Name of the core to get

) → (
boolean,--

false if failed

any--

The retrieved core, or the error if there was one

)

Tries to invoke StarterGui:GetCore with the core name specified

Show raw api
{
    "functions": [
        {
            "name": "promiseRetrySetCore",
            "desc": "Retries setting the core. This is required because sometimes the Core\nscripts are not initialized by the time that client code executes.",
            "params": [
                {
                    "name": "tries",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "initialWaitTime",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "...",
                    "desc": "parameters to set core with",
                    "lua_type": "any"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise<()>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 26,
                "path": "src/coreguiutils/src/Shared/CoreGuiUtils.lua"
            }
        },
        {
            "name": "promiseRetryGetCore",
            "desc": "Retries getting the core. Like [CoreGuiUtils.promiseRetrySetCore], this is required because\nthe Core scripts are not necessarily initialized by the time that client code executes.",
            "params": [
                {
                    "name": "tries",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "initialWaitTime",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "coreName",
                    "desc": "Name of the core to get",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise<any>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 65,
                "path": "src/coreguiutils/src/Shared/CoreGuiUtils.lua"
            }
        },
        {
            "name": "tryToSetCore",
            "desc": "Tries to invoke `StarterGui:SetCore` with the arguments specified",
            "params": [
                {
                    "name": "...",
                    "desc": "Args to try to call SetCore with",
                    "lua_type": "any"
                }
            ],
            "returns": [
                {
                    "desc": "false if failed",
                    "lua_type": "boolean"
                },
                {
                    "desc": "Error, if there was one",
                    "lua_type": "string?"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 100,
                "path": "src/coreguiutils/src/Shared/CoreGuiUtils.lua"
            }
        },
        {
            "name": "tryToGetCore",
            "desc": "Tries to invoke `StarterGui:GetCore` with the core name specified",
            "params": [
                {
                    "name": "coreName",
                    "desc": "Name of the core to get",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "false if failed",
                    "lua_type": "boolean"
                },
                {
                    "desc": "The retrieved core, or the error if there was one",
                    "lua_type": "any"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 121,
                "path": "src/coreguiutils/src/Shared/CoreGuiUtils.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "CoreGuiUtils",
    "desc": "Utility functions to work with the CoreGui",
    "source": {
        "line": 6,
        "path": "src/coreguiutils/src/Shared/CoreGuiUtils.lua"
    }
}