Skip to main content
Resource name is nex_battlepass.

Server exports

Use these to grant XP, push quest progress, and read a player’s battle pass state from your own server scripts. src is the player’s server id.
exports.nex_battlepass:AddXP(source, amount, 'reason')        -- grant XP
exports.nex_battlepass:AddQuestProgress(source, questId, amount)
exports.nex_battlepass:AddBuiltinProgress(source, 'killcount', 1)
local level   = exports.nex_battlepass:GetLevel(source)
local xp      = exports.nex_battlepass:GetXP(source)
local premium = exports.nex_battlepass:IsPremium(source)
ExportSignatureWhat it does
AddXPAddXP(src, amount, sourceLabel?)Grants amount XP to the player. sourceLabel is an optional reason string for logs (defaults to 'export'). Fires the level-up flow as needed.
AddQuestProgressAddQuestProgress(src, questId, amount?)Adds progress to the quest with id questId. amount defaults to 1.
AddBuiltinProgressAddBuiltinProgress(src, builtinType, amount?)Adds progress to every quest using the built-in tracker builtinType (playtime, killcount, swimdistance, rundistance). amount defaults to 1.
GetLevelGetLevel(src)numberReturns the player’s current level (1 if no data).
GetXPGetXP(src)numberReturns the player’s total XP (0 if no data).
IsPremiumIsPremium(src)booleanReturns whether the player has an active premium pass.
ReloadLevelsReloadLevels()Reloads levels/rewards from the DB after a direct database edit and live-refreshes open UIs — no restart needed.

Client exports

ExportSignatureWhat it does
openBattlepassopenBattlepass()Opens the battle pass UI for the local player.
closeBattlepasscloseBattlepass()Closes the battle pass UI.
isOpenisOpen()booleanReturns whether the UI is currently open.
-- open the battle pass from another resource (client side)
exports.nex_battlepass:openBattlepass()

Examples

Grant XP after a job

-- server side, after a player finishes a job
exports.nex_battlepass:AddXP(source, 250, 'job:delivery')

Gate content behind premium

-- server side
if exports.nex_battlepass:IsPremium(source) then
    -- give premium-only perk
end

Push custom quest progress

-- server side, when the player does the thing your custom quest tracks
exports.nex_battlepass:AddQuestProgress(source, 'mission_5', 1)
See Quests for defining custom quests.

Database tables

These are created automatically on first start — there is no SQL file to import.
TableHolds
nex_battlepassPlayer progress (XP, level, premium, claims)
nex_battlepass_levelsYour levels and their Standard / Advanced rewards (managed via /bpadmin)
nex_battlepass_codesSingle-use redemption codes (code mode)
nex_battlepass_redemptionsUsed Tebex transactions, so each can only be redeemed once