For the complete documentation index, see llms.txt. This page is also available as Markdown.

XP

Handles player XP tracking, leveling, and data persistence for skills, reputation, and other growth systems.


Accessing the Module

local XP <const> = exports.boii_utils:get("modules.xp")

Server

get_all_xp(source)

Retrieves all XP data for a player.

Parameters

Name
Type
Description

source

number

Player source ID

Returns

Type
Description

table

Table of XP entries

Example

local all_xp = XP.get_all(source)

get_xp(source, xp_id)

Gets a specific XP entry for a player.

Parameters

Name
Type
Description

source

number

Player source ID

xp_id

string

The XP ID

Returns

Type
Description

table

XP data for the ID

Example


set_xp(source, xp_id, amount)

Sets a player's XP to a fixed value.

Parameters

Name
Type
Description

source

number

Player source ID

xp_id

string

The XP ID

amount

number

Amount of XP to assign

Example


add_xp(source, xp_id, amount)

Adds XP to a player's skill and handles level-ups.

Parameters

Name
Type
Description

source

number

Player source ID

xp_id

string

The XP ID

amount

number

Amount of XP to add

Example


remove_xp(source, xp_id, amount)

Removes XP from a player's skill and handles level-downs.

Parameters

Name
Type
Description

source

number

Player source ID

xp_id

string

The XP ID

amount

number

Amount of XP to subtract

Example


Client

get_all_xp()

Requests all XP data for the local player.

Returns

Type
Description

table

XP data for player

Example

Last updated