Skip to main content

BadgeGiver

Handles awarding badges to players.

Functions

GiveBadge

This is a yielding function. When called, it will pause the Lua thread that called the function until a result is ready to be returned, without interrupting other scripts. Yields
BadgeGiver:GiveBadge(
playerPlayer,--

The player to award the badge to.

badgeIdnumber--

The ID of the badge to award.

) → ()

Awards the specified badge to the player if they do not already have it. Otherwise, records that we've already given the badge to this player in their data profile.

Show raw api
{
    "functions": [
        {
            "name": "GiveBadge",
            "desc": "Awards the specified badge to the player if they do not already have it.\nOtherwise, records that we've already given the badge to this player in\ntheir data profile.",
            "params": [
                {
                    "name": "player",
                    "desc": "The player to award the badge to.",
                    "lua_type": "Player"
                },
                {
                    "name": "badgeId",
                    "desc": "The ID of the badge to award.",
                    "lua_type": "number"
                }
            ],
            "returns": [],
            "function_type": "method",
            "yields": true,
            "source": {
                "line": 43,
                "path": "src/server/core/lib/BadgeGiver.luau"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "BadgeGiver",
    "desc": "Handles awarding badges to players.",
    "source": {
        "line": 26,
        "path": "src/server/core/lib/BadgeGiver.luau"
    }
}