🤠 Wild Country Libs
Server API

Battlepass

Thin pcall-guarded wrapper around exports.vlab_battlepass:AddExpToCharacter. Never crashes the calling resource if vlab_battlepass is absent or restarting.

AddBattlepassXP(charIdentifier, xp) → booleanserver

Awards battlepass XP directly by character identifier. Returns false silently if vlab_battlepass is not started.

ParamTypeDescription
charIdentifiernumber | stringFrom ch.charIdentifier / ch.identifier.
xpnumberXP to award.
AddBattlepassXPForPlayer(source, xp) → booleanserver

Resolves charIdentifier automatically from the player source via WCLibPlayer, then awards XP.

ParamTypeDescription
sourcenumberPlayer server source ID.
xpnumberXP to award.
example
-- recommended: resolve automatically from source
exports.wc_libs:AddBattlepassXPForPlayer(source, 100)

-- or if you already have the charIdentifier
exports.wc_libs:AddBattlepassXP(charIdentifier, 100)

Real Wild County example — safe optional integration

Every Green Studio resource can call this unconditionally — if vlab_battlepass isn't installed on a given server, it's just a no-op instead of an error.

wc_stagecoach/server/main.lua
-- safe to call even if this server doesn't run vlab_battlepass
wc:AddBattlepassXPForPlayer(src, 20)

Common mistakes

Troubleshooting