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.

formatDisplayNameFromUserInfo

PlayerUtils.formatDisplayNameFromUserInfo(userInfoUserInfo) → string

Formats the display name from the user info

addVerifiedBadgeToName

PlayerUtils.addVerifiedBadgeToName(namestring) → string

Adds verified badges to the name

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": 24,
                "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": 46,
                "path": "src/playerutils/src/Shared/PlayerUtils.lua"
            }
        },
        {
            "name": "formatDisplayNameFromUserInfo",
            "desc": "Formats the display name from the user info",
            "params": [
                {
                    "name": "userInfo",
                    "desc": "",
                    "lua_type": "UserInfo"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 65,
                "path": "src/playerutils/src/Shared/PlayerUtils.lua"
            }
        },
        {
            "name": "addVerifiedBadgeToName",
            "desc": "Adds verified badges to the name",
            "params": [
                {
                    "name": "name",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 85,
                "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": 122,
                "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": 132,
                "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": 154,
                "path": "src/playerutils/src/Shared/PlayerUtils.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "PlayerUtils",
    "desc": "",
    "source": {
        "line": 5,
        "path": "src/playerutils/src/Shared/PlayerUtils.lua"
    }
}