Events
Every event of the Battle Pass, with its arguments and an example
4 min read · Updated Dec 3, 2026
These events let your scripts react to the battle pass. They are server events: listen with AddEventHandler in a server script. In the tables, Required tells if the value is always sent.
Server events
topx_battlepass: onMissionComplete
A player finished a mission.
Side: Server
Fires when: the goal of a mission is reached.
Arguments
| Name | Type | Required | Description |
|---|---|---|---|
source | number or nil | Always | Server id of the player, nil when the player is offline. |
identifier | string | Always | Character id of the player. |
missionId | string | Always | Id of the mission. |
times | number | Always | How many times it was finished at once. More than 1 only for missions that repeat. |
How to use it
AddEventHandler('topx_battlepass:onMissionComplete', function(source, identifier, missionId, times)
print(('%s finished %s x%s'):format(identifier, missionId, times))
end)
topx_battlepass: onLevelUp
A player reached a higher level.
Side: Server
Fires when: XP is added or set and the level goes up.
Arguments
| Name | Type | Required | Description |
|---|---|---|---|
source | number or nil | Always | Server id of the player, nil when the player is offline. |
identifier | string | Always | Character id of the player. |
level | number | Always | The new level. |
previousLevel | number | Always | The level before. |
How to use it
AddEventHandler('topx_battlepass:onLevelUp', function(source, identifier, level, previousLevel)
if source and level >= 30 and previousLevel < 30 then
print(GetPlayerName(source) .. ' reached level 30')
end
end)
Good to know
- Several levels can be gained in one event, so compare both numbers.
topx_battlepass: onXpAdd
A player got XP.
Side: Server
Fires when: XP goes up, from a mission, the admin dashboard or an export.
Arguments
| Name | Type | Required | Description |
|---|---|---|---|
source | number or nil | Always | Server id of the player, nil when the player is offline. |
identifier | string | Always | Character id of the player. |
amount | number | Always | XP that was really added. |
totalXp | number | Always | Total XP after the change. |
reason | string or nil | Optional | The reason, for a mission its name. |
How to use it
AddEventHandler('topx_battlepass:onXpAdd', function(source, identifier, amount, totalXp, reason)
print(('%s +%s XP (%s), total %s'):format(identifier, amount, reason or 'no reason', totalXp))
end)
topx_battlepass: onXpRemove
A player lost XP.
Side: Server
Fires when: XP is removed, or set to a lower value.
Arguments
| Name | Type | Required | Description |
|---|---|---|---|
source | number or nil | Always | Server id of the player, nil when the player is offline. |
identifier | string | Always | Character id of the player. |
amount | number | Always | XP that was really removed. |
totalXp | number | Always | Total XP after the change. |
reason | string or nil | Optional | The reason, when one was given. |
How to use it
AddEventHandler('topx_battlepass:onXpRemove', function(source, identifier, amount, totalXp, reason)
print(('%s -%s XP, total %s'):format(identifier, amount, totalXp))
end)
topx_battlepass: onRewardClaim
A player claimed the rewards of a level.
Side: Server
Fires when: at least one reward of a level and tier was given.
Arguments
| Name | Type | Required | Description |
|---|---|---|---|
source | number | Always | Server id of the player. |
identifier | string | Always | Character id of the player. |
level | number | Always | The level of the rewards. |
tier | string | Always | free or premium. |
rewards | table | Always | List of rewards. Each has a type: item (item, count), money (amount, account) or vehicle (model). |
How to use it
AddEventHandler('topx_battlepass:onRewardClaim', function(source, identifier, level, tier, rewards)
for _, reward in ipairs(rewards) do
if reward.type == 'vehicle' then
print(('%s got a %s at level %s (%s)'):format(identifier, reward.model, level, tier))
end
end
end)
topx_battlepass: onPremiumChange
The premium of a player was turned on or off.
Side: Server
Fires when: premium changes by Tebex, an admin or SetPremium.
Arguments
| Name | Type | Required | Description |
|---|---|---|---|
source | number or nil | Always | Server id of the player, nil when the player is offline. |
identifier | string | Always | Character id of the player. |
hasPremium | boolean | Always | The new state. |
by | string | Always | Tebex, export or the name of the admin. |
How to use it
AddEventHandler('topx_battlepass:onPremiumChange', function(source, identifier, hasPremium, by)
print(('%s premium = %s (by %s)'):format(identifier, tostring(hasPremium), by))
end)
topx_battlepass: onSeasonReset
A season ended and a new one started.
Side: Server
Fires when: the timer of a timed pass runs out, or an admin uses Force reset.
Arguments
| Name | Type | Required | Description |
|---|---|---|---|
newSeason | number | Always | Number of the new season. |
oldSeason | number | Always | Number of the season that ended. |
by | string | Always | timer, or the name of the admin. |
How to use it
AddEventHandler('topx_battlepass:onSeasonReset', function(newSeason, oldSeason, by)
print(('Season %s ended, season %s started (%s)'):format(oldSeason, newSeason, by))
end)