Skip to main content

ClientObjects

This item only works when running on the client. Client

A table of utility functions for working with Client Objects that can be used to speed up the process of writing repository scripts for client objects.

Functions

isButtonActivatedPlatform

shorthand
ClientObjects.isButtonActivatedPlatform(platformInstance) → boolean

This function is used to check if the provided Instance is a ButtonActivatedPlatform.

This will return true if it is a BasePart and meets one of the following requirements:

  • Is named ButtonActivatedPlatform
  • Has a tag named ButtonActivated

isBalloon

shorthand
ClientObjects.isBalloon(
parentInstance,
doNotCheckAncestorboolean?
) → boolean

This function is used to check if the provided Instance is part of a dispensed Balloon.

This will return true if it meets one of the following requirements:

  • Is named BalloonModel
  • If doNotCheckAncestor is not true and the Instance has an ancestor named BalloonModel

isTurret

shorthand
ClientObjects.isTurret(
parentInstance,
doNotCheckAncestorboolean?
) → boolean

This function is used to check if the provided Instance is part of a Turret's bullet.

This will return true if it meets one of the following requirements:

  • Is named Bullet
  • If doNotCheckAncestor is not true and the Instance has an ancestor named Bullet

isPushbox

shorthand
ClientObjects.isPushbox(
parentInstance,
doNotCheckAncestorboolean?
) → boolean

This function is used to check if the provided Instance is part of a Pushbox. This will return true if it meets one of the following requirements:

  • Is named Pushbox
  • Has a tag named IsBox
  • If doNotCheckAncestor is not true and the Instance has an ancestor named Pushbox

validatePlayerToucher

ClientObjects.validatePlayerToucher(
toucherBasePart,
modeCharacter.HitboxModes?
) → boolean

This function checks if the given toucher is part of the character's hitbox mode provided.

evaluateToucher

ClientObjects.evaluateToucher(
partBasePart,
toucherBasePart,
config(Instance | typeof(Config.TOUCH_CONFIG))?
) → boolean

This function checks if two BaseParts (part and toucher) touching is considered valid or not, based on the provided config.

See this page for more info.

bindToFlip

ClientObjects.bindToFlip(
partBasePart,
callback(rootPartBasePart) → ()
) → () → ()

Binds the callback function to the part, executing the callback when the player performs a corner flip on it.

formatTimerText

ClientObjects.formatTimerText(
textstring,
decimalPlacesnumber,
timeRemainingnumber
) → string

Function to format timer labels in a standardized manner, used in Buttons and Morphers. Below are special codes that are replaced within the string automatically.

Code Replaced with:
{T} The time left on the timer, modified with TimerDecimalPlaces
{M} The minutes left on the timer
{S} The seconds left on the timer
{MS} The milliseconds left on the timer
{SM} Used for grammatical reasons. When the amount of minutes left is equal to one, this will display the letter "s", otherwise this will display nothing. e.g. "minute{SM}" will either display "minutes" or "minute".
{SS} Used for grammatical reasons. When the amount of seconds left is equal to one, this will display the letter "s", otherwise this will display nothing. e.g. "second{SM}" will either display "seconds" or "second".
{Pn} The player's username
{pn} The username in all lowercase
{PN} The username in all UPPERCASE
{Dn} The player's Display Name
{dn} The Display Name in all lowercase
{DN} The Display Name in all UPPERCASE
{UID} The player's User ID

isInstanceActive

ClientObjects.isInstanceActive(
scopeScope,
instanceInstance,
ignoreList{[string]boolean}?
) → boolean

Returns whether the provided Instance is active or not.

listenInstanceActive

ClientObjects.listenInstanceActive(
scopeScope,
instanceInstance,
ignoreList{[string]boolean}?,
callback(activeboolean) → ()
) → () → ()

Listens to the Instance's activeness, executing the callback when it's activeness changes.

setInstanceActive

ClientObjects.setInstanceActive(
scopeScope,
instanceInstance,
keystring,
activeboolean
) → ()

Sets the Instance's activeness based on active. Instances can have multiple activeness states, dictated by the key parameter.

scanFolder

ClientObjects.scanFolder(
targetScopeScope,
pathInstance,
targetPathInstance?
) → ()

Scans the given folder and loads any client objects within into the given scope. Used for client objects that can spawn other client objects, such as Pushboxes.

Show raw api
{
    "functions": [
        {
            "name": "isButtonActivatedPlatform",
            "desc": "This function is used to check if the provided `Instance`\nis a ButtonActivatedPlatform.\n\nThis will return `true` if it is a `BasePart` and meets\none of the following requirements:\n\t\n* Is named `ButtonActivatedPlatform`\n* Has a tag named `ButtonActivated`",
            "params": [
                {
                    "name": "platform",
                    "desc": "",
                    "lua_type": "Instance"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean\n"
                }
            ],
            "function_type": "static",
            "tags": [
                "shorthand"
            ],
            "source": {
                "line": 39,
                "path": "mirror/Kit.Utility.ClientObjects.luau"
            }
        },
        {
            "name": "isBalloon",
            "desc": "This function is used to check if the provided `Instance` \nis part of a dispensed Balloon.\n\nThis will return `true` if it meets one of the following requirements:\n\t\n* Is named `BalloonModel`\n* If `doNotCheckAncestor` is not `true` and the `Instance` has an ancestor\nnamed `BalloonModel`",
            "params": [
                {
                    "name": "parent",
                    "desc": "",
                    "lua_type": "Instance"
                },
                {
                    "name": "doNotCheckAncestor",
                    "desc": "",
                    "lua_type": "boolean?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean\n"
                }
            ],
            "function_type": "static",
            "tags": [
                "shorthand"
            ],
            "source": {
                "line": 60,
                "path": "mirror/Kit.Utility.ClientObjects.luau"
            }
        },
        {
            "name": "isTurret",
            "desc": "This function is used to check if the provided `Instance` \nis part of a Turret's bullet.\n\nThis will return `true` if it meets one of the following requirements:\n\n* Is named `Bullet`\n* If `doNotCheckAncestor` is not `true` and the `Instance` has an ancestor\nnamed `Bullet`\n\t",
            "params": [
                {
                    "name": "parent",
                    "desc": "",
                    "lua_type": "Instance"
                },
                {
                    "name": "doNotCheckAncestor",
                    "desc": "",
                    "lua_type": "boolean?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean\n"
                }
            ],
            "function_type": "static",
            "tags": [
                "shorthand"
            ],
            "source": {
                "line": 82,
                "path": "mirror/Kit.Utility.ClientObjects.luau"
            }
        },
        {
            "name": "isPushbox",
            "desc": "This function is used to check if the provided `Instance` \nis part of a Pushbox.\nThis will return `true` if it meets one of the following requirements:\n\n* Is named `Pushbox`\n* Has a tag named `IsBox`\n* If `doNotCheckAncestor` is not `true` and the `Instance` has an ancestor\nnamed `Pushbox`",
            "params": [
                {
                    "name": "parent",
                    "desc": "",
                    "lua_type": "Instance"
                },
                {
                    "name": "doNotCheckAncestor",
                    "desc": "",
                    "lua_type": "boolean?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean\n"
                }
            ],
            "function_type": "static",
            "tags": [
                "shorthand"
            ],
            "source": {
                "line": 104,
                "path": "mirror/Kit.Utility.ClientObjects.luau"
            }
        },
        {
            "name": "validatePlayerToucher",
            "desc": "This function checks if the given `toucher` is part of the character's hitbox mode provided.",
            "params": [
                {
                    "name": "toucher",
                    "desc": "",
                    "lua_type": "BasePart"
                },
                {
                    "name": "mode",
                    "desc": "",
                    "lua_type": "Character.HitboxModes?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 118,
                "path": "mirror/Kit.Utility.ClientObjects.luau"
            }
        },
        {
            "name": "evaluateToucher",
            "desc": "This function checks if two `BasePart`s (`part` and `toucher`) touching\nis considered valid or not, based on the provided `config`.\n\nSee [this page](/docs/global-configurations/touch-configurations) for more info.",
            "params": [
                {
                    "name": "part",
                    "desc": "",
                    "lua_type": "BasePart"
                },
                {
                    "name": "toucher",
                    "desc": "",
                    "lua_type": "BasePart"
                },
                {
                    "name": "config",
                    "desc": "",
                    "lua_type": "(Instance | typeof(Config.TOUCH_CONFIG))?\n"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 131,
                "path": "mirror/Kit.Utility.ClientObjects.luau"
            }
        },
        {
            "name": "bindToFlip",
            "desc": "Binds the `callback` function to the `part`, executing the callback when\nthe player performs a corner flip on it.",
            "params": [
                {
                    "name": "part",
                    "desc": "",
                    "lua_type": "BasePart"
                },
                {
                    "name": "callback",
                    "desc": "",
                    "lua_type": "(rootPart: BasePart) -> ()"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "() -> ()\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 173,
                "path": "mirror/Kit.Utility.ClientObjects.luau"
            }
        },
        {
            "name": "formatTimerText",
            "desc": "Function to format timer labels in a standardized manner, used in Buttons and Morphers.\nBelow are special codes that are replaced within the string automatically.\n\n|  Code  | Replaced with: |\n|--------|---------------------------|\n| `{T}` | The time left on the timer, modified with `TimerDecimalPlaces` |\n| `{M}` | The minutes left on the timer |\n| `{S}` | The seconds left on the timer |\n| `{MS}` | The milliseconds left on the timer |\n| `{SM}` | Used for grammatical reasons. When the amount of minutes left is equal to one, this will display the letter \"s\", otherwise this will display nothing. e.g. \"minute{SM}\" will either display \"minutes\" or \"minute\". |\n| `{SS}` | Used for grammatical reasons. When the amount of seconds left is equal to one, this will display the letter \"s\", otherwise this will display nothing. e.g. \"second{SM}\" will either display \"seconds\" or \"second\". |\n| `{Pn}` | The player's username |\n| `{pn}` | The username in all lowercase |\n| `{PN}` | The username in all UPPERCASE |\n| `{Dn}` | The player's Display Name |\n| `{dn}` | The Display Name in all lowercase |\n| `{DN}` | The Display Name in all UPPERCASE |\n| `{UID}` | The player's User ID |",
            "params": [
                {
                    "name": "text",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "decimalPlaces",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "timeRemaining",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "string\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 199,
                "path": "mirror/Kit.Utility.ClientObjects.luau"
            }
        },
        {
            "name": "isInstanceActive",
            "desc": "Returns whether the provided `Instance` is active or not.",
            "params": [
                {
                    "name": "scope",
                    "desc": "",
                    "lua_type": "Scope"
                },
                {
                    "name": "instance",
                    "desc": "",
                    "lua_type": "Instance"
                },
                {
                    "name": "ignoreList",
                    "desc": "",
                    "lua_type": "{ [string]: boolean }?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 233,
                "path": "mirror/Kit.Utility.ClientObjects.luau"
            }
        },
        {
            "name": "listenInstanceActive",
            "desc": "Listens to the `Instance`'s activeness, executing the `callback` when\nit's activeness changes.",
            "params": [
                {
                    "name": "scope",
                    "desc": "",
                    "lua_type": "Scope"
                },
                {
                    "name": "instance",
                    "desc": "",
                    "lua_type": "Instance"
                },
                {
                    "name": "ignoreList",
                    "desc": "",
                    "lua_type": "{ [string]: boolean }?"
                },
                {
                    "name": "callback",
                    "desc": "",
                    "lua_type": "(active: boolean) -> ()\n"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "() -> ()\n"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 270,
                "path": "mirror/Kit.Utility.ClientObjects.luau"
            }
        },
        {
            "name": "setInstanceActive",
            "desc": "Sets the `Instance`'s activeness based on `active`.\nInstances can have multiple activeness states, dictated by the `key` parameter.",
            "params": [
                {
                    "name": "scope",
                    "desc": "",
                    "lua_type": "Scope"
                },
                {
                    "name": "instance",
                    "desc": "",
                    "lua_type": "Instance"
                },
                {
                    "name": "key",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "active",
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 292,
                "path": "mirror/Kit.Utility.ClientObjects.luau"
            }
        },
        {
            "name": "scanFolder",
            "desc": "Scans the given folder and loads any client objects within into the given scope.\nUsed for client objects that can spawn other client objects, such as Pushboxes.",
            "params": [
                {
                    "name": "targetScope",
                    "desc": "",
                    "lua_type": "Scope"
                },
                {
                    "name": "path",
                    "desc": "",
                    "lua_type": "Instance"
                },
                {
                    "name": "targetPath",
                    "desc": "",
                    "lua_type": "Instance?"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 317,
                "path": "mirror/Kit.Utility.ClientObjects.luau"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "ClientObjects",
    "desc": "A table of utility functions for working with Client Objects that can be used to speed up the process of writing repository scripts for client objects.",
    "realm": [
        "Client"
    ],
    "source": {
        "line": 13,
        "path": "mirror/Kit.Utility.ClientObjects.luau"
    }
}