Server Exports
AddXP
Awards XP to a player for a skill. Active XP buffs are applied using:ok(boolean) —trueon success,falseon failureresult(table | string)- On success (table):
skill(string) — skill IDamount(number) — XP awarded after buffsxp(number) — current XP toward the next leveltotalXp(number) — lifetime XP for the skilllevel(number) — current levelpreviousLevel(number) — level before this awardleveledUp(boolean) — whether the player leveled upmilestones(table) — milestones reached from this award (if any)
- On failure (string), common values include:
'invalid_player''invalid_skill''invalid_amount''max_level'
- On success (table):
AddXPRaw
Awards XP while ignoring active XP buffs (no multiplier or flat bonus applied).AddXP.
RemoveXP
Removes XP from a player for a skill.ok(boolean)result(table | string) — updated skill state on success, or an error string on failure
SetLevel
Sets a player’s level for a skill directly.ok(boolean)result(table | string) — updated skill state on success, or an error string on failure
GetSkill
Returns a single skill record for a player.tableornil— skill data (level,xp,totalXp, etc.)
GetSkills
Returns all skill records for a player.table— map of skill ID → skill data
GetLevel
Returns the player’s current level for a skill.number— current level (typically0if missing)
GetTotalXp
Returns the player’s total (lifetime) XP for a skill.number— total XP
GetSkillIds
Returns the configured skill IDs.table— list of skill ID strings
OpenMenu
Opens the XP menu for a player from the server.SyncClient
Forces a client sync of the player’s XP data.AddXpBuff
Adds a temporary XP buff. Multiple buffs stack. Award formula while buffs are active:RemoveXpBuff
Removes an active XP buff by ID (or matching options, depending on usage).boolean— whether a buff was removed
GetXpBuffs
Returns active XP buffs for a player.table— list of active buffs
GetXpMultiplier
Returns the combined XP multiplier (and related totals) currently applied for a skill.number— combined multiplier total used byAddXP
Client Exports
OpenMenu
Opens the XP menu on the local client.IsMenuOpen
Returns whether the XP menu is currently open.boolean
RefreshMenu
Refreshes the XP menu UI if it is open.GetXpBuffs
Returns active XP buffs known to the client.table— list of active buffs
Bridge Integration
WhenXPSystem is set to 'projectx' (or 'auto' and projectx-xp is running), Project X scripts can award and read XP through the bridge:
XPSystem options.
