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

Events

Give XP (server-sided)

local success = exports['ak4y-multicharacter-v3']:GiveXp(source, amount) --return true of false
Parameter
Type
Description

source

number

The player id

amount

number

The amount you want to add

Get Level (server-sided)

local playerLevel = exports['ak4y-multicharacter-v3']:GetLevel(source)
Parameter
Type
Description

source

number

The player id

Example Usage;

print("Player is level: " .. playerLevel)

Client-side Events Triggered

ak4y-multicharacter-v3:LevelUp (newLevel, oldLevel) - When player levels up
ak4y-multicharacter-v3:XpIncrease (xpGained, totalXp, currentLevel) - When XP increases

Notes;

  • The system automatically handles database creation if a player doesn't have an XP record

  • Level is calculated as: floor(XP / Config.NeedXpForLevel) + 1

  • Minimum level is always 1

  • XP can be negative, but this is not recommended

  • The system works with both QB and ESX frameworks

  • All XP operations are automatically saved to the database