Server Exports

Server exports available for other resources

getPersonalStats

Gets the stats of a player by their server ID

exports.mad_collectables:getPersonalStats(source)
  • source: number

    • The player's server ID

  • returns: table | nil

    • Returns a table containing the player's collectable statistics, or nil if the player is not found

{
    displayName = string,      -- Player's display name
    totalCollected = number,   -- Total collectables collected
    totalAvailable = number,   -- Total collectables available
    setsCompleted = number,    -- Number of completed sets
    totalSets = number,        -- Total number of sets
    optedIn = boolean,         -- Whether player opted into leaderboard
    rank = number,             -- Player's leaderboard rank (if opted in)
    sets = {                   -- Array of collectable sets
        {
            key = string,              -- Set identifier
            label = string,            -- Display name of the set
            description = string,      -- Set description
            icon = string,             -- Icon filename
            totalItems = number,       -- Total items in set
            collectedCount = number,   -- Number collected in this set
            isCompleted = boolean,     -- Whether set is complete
            items = {                  -- Array of items in set
                {
                    id = string,           -- Item identifier
                    index = number,        -- Item index in set
                    setKey = string,       -- Parent set key
                    hint = string,         -- Location hint
                    collected = boolean,   -- Whether collected
                    collectedAt = number?, -- Unix timestamp (ms) when collected
                    placed = boolean?,     -- Whether sticker placed in album
                    placedAt = string?     -- ISO timestamp when placed
                }
            }
        }
    }
}

Example

Last updated