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

NameTypeRequiredDescription
sourcenumber or nilAlwaysServer id of the player, nil when the player is offline.
identifierstringAlwaysCharacter id of the player.
missionIdstringAlwaysId of the mission.
timesnumberAlwaysHow many times it was finished at once. More than 1 only for missions that repeat.

How to use it

lua
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

NameTypeRequiredDescription
sourcenumber or nilAlwaysServer id of the player, nil when the player is offline.
identifierstringAlwaysCharacter id of the player.
levelnumberAlwaysThe new level.
previousLevelnumberAlwaysThe level before.

How to use it

lua
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

NameTypeRequiredDescription
sourcenumber or nilAlwaysServer id of the player, nil when the player is offline.
identifierstringAlwaysCharacter id of the player.
amountnumberAlwaysXP that was really added.
totalXpnumberAlwaysTotal XP after the change.
reasonstring or nilOptionalThe reason, for a mission its name.

How to use it

lua
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

NameTypeRequiredDescription
sourcenumber or nilAlwaysServer id of the player, nil when the player is offline.
identifierstringAlwaysCharacter id of the player.
amountnumberAlwaysXP that was really removed.
totalXpnumberAlwaysTotal XP after the change.
reasonstring or nilOptionalThe reason, when one was given.

How to use it

lua
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

NameTypeRequiredDescription
sourcenumberAlwaysServer id of the player.
identifierstringAlwaysCharacter id of the player.
levelnumberAlwaysThe level of the rewards.
tierstringAlwaysfree or premium.
rewardstableAlwaysList of rewards. Each has a type: item (item, count), money (amount, account) or vehicle (model).

How to use it

lua
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

NameTypeRequiredDescription
sourcenumber or nilAlwaysServer id of the player, nil when the player is offline.
identifierstringAlwaysCharacter id of the player.
hasPremiumbooleanAlwaysThe new state.
bystringAlwaysTebex, export or the name of the admin.

How to use it

lua
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

NameTypeRequiredDescription
newSeasonnumberAlwaysNumber of the new season.
oldSeasonnumberAlwaysNumber of the season that ended.
bystringAlwaystimer, or the name of the admin.

How to use it

lua
AddEventHandler('topx_battlepass:onSeasonReset', function(newSeason, oldSeason, by)
    print(('Season %s ended, season %s started (%s)'):format(oldSeason, newSeason, by))
end)