Skip to main content

CharacterManager

This item only works when running on the client. Client

Manager module for character-related things such as collisions, damage bricks, and boosts.

Currently, the valid types for Boosters and Boost Pads are:

  • Speed for WalkSpeed
  • Jump for JumpPower

Types

BoostData

interface BoostData {
isPadboolean
startTimenumber
modestring
typestring
powernumber
durationnumber
timerDecimalsboolean
hideGUIboolean
startTweenInfoTweenInfo
endtweenInfoTweenInfo
infiniteboolean
multipliernumber
timeLeftnumber
}

Functions

ValidateDamageBrick

CharacterManager:ValidateDamageBrick(brickBasePart) → ()

Function internally used to validate a damage brick's damage value. This also checks whether the damage brick is deactivated or not.

Damage

CharacterManager:Damage(damageBasePart | string | number) → ()

Fires the DamageEvent with the given damage value. damage can be either a number, or a string representing a key in the VALID_DAMAGEBRICKS table.

GetHumanoid

CharacterManager:GetHumanoid(playerPlayer) → Humanoid?

Returns the player's Humanoid if it exists.

GetActiveBoost

CharacterManager:GetActiveBoost(
boostTypestring,
isPadboolean?
) → _TDefs.BoostData?

Get a currently active boost with the given boostType. If isPad is true, it will return the currently active boost pad. Otherwise, it will return the currently active regular boost.

IsBoostInfinite

CharacterManager:IsBoostInfinite(boostData_TDefs.BoostData) → boolean

Returns whether a given boost should be infinite or not. Boosts with a duration of 0 or below, or higher than 10^10 are considered infinite and will never run out unless removed by a boost remover.

StartBoost

CharacterManager:StartBoost(boostData_TDefs.BoostData) → ()

Starts a boost with the given boost data. If a boost with the given type is already active, the already active boost will be refreshed instead of a new boost being started.

UpdateBoost

CharacterManager:UpdateBoost(
boostData_TDefs.BoostData,
boostEndedboolean?
) → ()

Updates the given boost, updating the affected property. If boostEnded is true, the character will return to it's default properties rather than using the boost's power.

RemoveBoost

CharacterManager:RemoveBoost(boostData_TDefs.BoostData) → ()

Ends the given boost.

GetActiveBoosts

CharacterManager:GetActiveBoosts() → {_TDefs.BoostData}

Returns a table containing the currently active boosts.

Show raw api
{
    "functions": [
        {
            "name": "ValidateDamageBrick",
            "desc": "Function internally used to validate a damage brick's damage value.\nThis also checks whether the damage brick is deactivated or not.",
            "params": [
                {
                    "name": "brick",
                    "desc": "",
                    "lua_type": "BasePart"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 109,
                "path": "mirror/Kit.Managers.CharacterManager.luau"
            }
        },
        {
            "name": "Damage",
            "desc": "Fires the DamageEvent with the given `damage` value.\n`damage` can be either a `number`, or a `string` representing a key in the\n`VALID_DAMAGEBRICKS` table.",
            "params": [
                {
                    "name": "damage",
                    "desc": "",
                    "lua_type": "BasePart | string | number"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 141,
                "path": "mirror/Kit.Managers.CharacterManager.luau"
            }
        },
        {
            "name": "GetHumanoid",
            "desc": "Returns the `player`'s `Humanoid` if it exists.",
            "params": [
                {
                    "name": "player",
                    "desc": "",
                    "lua_type": "Player"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Humanoid?\n"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 172,
                "path": "mirror/Kit.Managers.CharacterManager.luau"
            }
        },
        {
            "name": "GetActiveBoost",
            "desc": "Get a currently active boost with the given `boostType`.\nIf `isPad` is true, it will return the currently active boost pad. Otherwise,\nit will return the currently active regular boost.",
            "params": [
                {
                    "name": "boostType",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "isPad",
                    "desc": "",
                    "lua_type": "boolean?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "_TDefs.BoostData?\n"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 188,
                "path": "mirror/Kit.Managers.CharacterManager.luau"
            }
        },
        {
            "name": "IsBoostInfinite",
            "desc": "Returns whether a given boost should be infinite or not. Boosts with a duration\nof 0 or below, or higher than 10^10 are considered infinite and\nwill never run out unless removed by a boost remover.",
            "params": [
                {
                    "name": "boostData",
                    "desc": "",
                    "lua_type": "_TDefs.BoostData"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean\n"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 205,
                "path": "mirror/Kit.Managers.CharacterManager.luau"
            }
        },
        {
            "name": "StartBoost",
            "desc": "Starts a boost with the given boost data.\nIf a boost with the given type is already active, the already active boost will be\nrefreshed instead of a new boost being started.",
            "params": [
                {
                    "name": "boostData",
                    "desc": "",
                    "lua_type": "_TDefs.BoostData"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 216,
                "path": "mirror/Kit.Managers.CharacterManager.luau"
            }
        },
        {
            "name": "UpdateBoost",
            "desc": "Updates the given boost, updating the affected property.\nIf `boostEnded` is `true`, the character will return to it's default properties\nrather than using the boost's power.",
            "params": [
                {
                    "name": "boostData",
                    "desc": "",
                    "lua_type": "_TDefs.BoostData"
                },
                {
                    "name": "boostEnded",
                    "desc": "",
                    "lua_type": "boolean?"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 281,
                "path": "mirror/Kit.Managers.CharacterManager.luau"
            }
        },
        {
            "name": "RemoveBoost",
            "desc": "Ends the given boost.",
            "params": [
                {
                    "name": "boostData",
                    "desc": "",
                    "lua_type": "_TDefs.BoostData"
                }
            ],
            "returns": [],
            "function_type": "method",
            "source": {
                "line": 318,
                "path": "mirror/Kit.Managers.CharacterManager.luau"
            }
        },
        {
            "name": "GetActiveBoosts",
            "desc": "Returns a table containing the currently active boosts.",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "{ _TDefs.BoostData }\n"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 332,
                "path": "mirror/Kit.Managers.CharacterManager.luau"
            }
        }
    ],
    "properties": [],
    "types": [
        {
            "name": "BoostData",
            "desc": "",
            "fields": [
                {
                    "name": "isPad",
                    "lua_type": "boolean",
                    "desc": ""
                },
                {
                    "name": "startTime",
                    "lua_type": "number",
                    "desc": ""
                },
                {
                    "name": "mode",
                    "lua_type": "string",
                    "desc": ""
                },
                {
                    "name": "type",
                    "lua_type": "string",
                    "desc": ""
                },
                {
                    "name": "power",
                    "lua_type": "number",
                    "desc": ""
                },
                {
                    "name": "duration",
                    "lua_type": "number",
                    "desc": ""
                },
                {
                    "name": "timerDecimals",
                    "lua_type": "boolean",
                    "desc": ""
                },
                {
                    "name": "hideGUI",
                    "lua_type": "boolean",
                    "desc": ""
                },
                {
                    "name": "startTweenInfo",
                    "lua_type": "TweenInfo",
                    "desc": ""
                },
                {
                    "name": "endtweenInfo",
                    "lua_type": "TweenInfo",
                    "desc": ""
                },
                {
                    "name": "infinite",
                    "lua_type": "boolean",
                    "desc": ""
                },
                {
                    "name": "multiplier",
                    "lua_type": "number",
                    "desc": ""
                },
                {
                    "name": "timeLeft",
                    "lua_type": "number",
                    "desc": ""
                }
            ],
            "source": {
                "line": 35,
                "path": "mirror/Kit.Managers.CharacterManager.TypeDefs.luau"
            }
        }
    ],
    "name": "CharacterManager",
    "desc": "Manager module for character-related things such as collisions, damage\nbricks, and boosts.\n\nCurrently, the valid types for Boosters and Boost Pads are:\n* `Speed` for WalkSpeed\n* `Jump` for JumpPower",
    "realm": [
        "Client"
    ],
    "source": {
        "line": 18,
        "path": "mirror/Kit.Managers.CharacterManager.luau"
    }
}