Skip to main content

PlayerUtils

Functions

formatName

PlayerUtils.formatName(playerPlayer) → string--

Formatted name

Human-readable version of a player name. If the player's name is the same as the display name, then returns that player's name. Otherwise returns a formatted name with the player's name like this "oot (@martxn)" which lets you know the username and the display name.

Note this is not localized, although most languages should be ok. Great for output for dev logs and command services which are less picky.

formatDisplayName

PlayerUtils.formatDisplayName(
namestring,
displayNamestring
) → string--

Formatted name

Human-readable version of a player name. If the player's name is the same as the display name, then returns that player's name. Otherwise returns a formatted name with the player's name like this "oot (@martxn)" which lets you know the username and the display name.

Note this is not localized, although most languages should be ok. Great for output for dev logs and command services which are less picky.

getDefaultNameColor

PlayerUtils.getDefaultNameColor(displayNamestring) → Color3

Retrieves the display name color for a given player (for the Roblox chat)

promiseLoadCharacter

PlayerUtils.promiseLoadCharacter(playerPlayer) → Promise<Model>

Calls :LoadCharacter() in a promise

promiseLoadCharacterWithHumanoidDescription

PlayerUtils.promiseLoadCharacterWithHumanoidDescription(
playerPlayer,
humanoidDescriptionHumanoidDescription
) → Promise<Model>

Calls :LoadCharacterWithHumanoidDescription() in a promise

Show raw api
{
    "functions": [
        {
            "name": "formatName",
            "desc": "Human-readable version of a player name. If the player's name is the same\nas the display name, then returns that player's name. Otherwise returns\na formatted name with the player's name like this \"oot (@martxn)\" which\nlets you know the username and the display name.\n\nNote this is not localized, although most languages should be ok. Great for\noutput for dev logs and command services which are less picky.",
            "params": [
                {
                    "name": "player",
                    "desc": "",
                    "lua_type": "Player"
                }
            ],
            "returns": [
                {
                    "desc": "Formatted name",
                    "lua_type": "string"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 23,
                "path": "src/playerutils/src/Shared/PlayerUtils.lua"
            }
        },
        {
            "name": "formatDisplayName",
            "desc": "Human-readable version of a player name. If the player's name is the same\nas the display name, then returns that player's name. Otherwise returns\na formatted name with the player's name like this \"oot (@martxn)\" which\nlets you know the username and the display name.\n\nNote this is not localized, although most languages should be ok. Great for\noutput for dev logs and command services which are less picky.",
            "params": [
                {
                    "name": "name",
                    "desc": "",
                    "lua_type": "string"
                },
                {
                    "name": "displayName",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "Formatted name",
                    "lua_type": "string"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 45,
                "path": "src/playerutils/src/Shared/PlayerUtils.lua"
            }
        },
        {
            "name": "getDefaultNameColor",
            "desc": "Retrieves the display name color for a given player (for the Roblox chat)",
            "params": [
                {
                    "name": "displayName",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Color3"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 86,
                "path": "src/playerutils/src/Shared/PlayerUtils.lua"
            }
        },
        {
            "name": "promiseLoadCharacter",
            "desc": "Calls :LoadCharacter() in a promise",
            "params": [
                {
                    "name": "player",
                    "desc": "",
                    "lua_type": "Player"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise<Model>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 96,
                "path": "src/playerutils/src/Shared/PlayerUtils.lua"
            }
        },
        {
            "name": "promiseLoadCharacterWithHumanoidDescription",
            "desc": "Calls :LoadCharacterWithHumanoidDescription() in a promise",
            "params": [
                {
                    "name": "player",
                    "desc": "",
                    "lua_type": "Player"
                },
                {
                    "name": "humanoidDescription",
                    "desc": "",
                    "lua_type": "HumanoidDescription"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise<Model>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 118,
                "path": "src/playerutils/src/Shared/PlayerUtils.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "PlayerUtils",
    "desc": "",
    "source": {
        "line": 4,
        "path": "src/playerutils/src/Shared/PlayerUtils.lua"
    }
}