Server Exports

Server exports let your own server scripts ban and kick players, pause detections while a script does something unusual on purpose, and report their own detections to CXA Anticheat, using exports (functions that one resource offers to other resources).

Server-Side Only

Every export on this page runs on the server. Call them from server_script files only. CXA Anticheat has no public events: its internal events can change between versions, so never trigger or listen to them from your scripts.

How to Call the Exports

In Lua, call an export with a colon. In JavaScript or TypeScript, use a dot. The resource name is always cxa-anticheat.

-- Colon syntax: exports['resource']:ExportName(...)
local active = exports['cxa-anticheat']:IsActive()
print(('CXA Anticheat active: %s'):format(tostring(active)))

Check That the Anticheat Is Running

Calling an export of a resource that is not started throws an error. CXA Anticheat also restarts itself a few seconds after you save a new config in the panel, so it can be briefly unavailable while your server is running. Wrap your calls in a small helper that checks the resource state first and then asks IsActive().

IsActive() returns true only when the folder is named cxa-anticheat, the anticheat has started and the license is verified.

-- Returns true when cxa-anticheat is started and protecting the server
local function cxaReady()
    if GetResourceState('cxa-anticheat') ~= 'started' then
        return false
    end
    local ok, active = pcall(function()
        return exports['cxa-anticheat']:IsActive()
    end)
    return ok and active == true
end

In server.cfg, put ensure cxa-anticheat above the resources that call these exports, so the exports exist when your scripts start.

Overview

ExportWhat it doesPage
BanPlayerBans an online player with a CXA ban ID and drops them with the ban screenBan & Kick Exports
KickPlayerDrops an online player with the kick screenBan & Kick Exports
UnbanPlayerRemoves an active ban by its ban IDBan & Kick Exports
GetBanReturns the record of an active banBan & Kick Exports
IsIdentifierBannedChecks whether an identifier or hardware token is bannedBan & Kick Exports
IsPlayerBypassedTells you whether a player skips every checkBypass & Pause Exports
RefreshBypassRecalculates a player's bypass after you changed their groupBypass & Pause Exports
SetTemporaryBypassPauses every detection for one player for a number of secondsBypass & Pause Exports
PauseDetectionPauses one detection, or a group of detections, for one playerBypass & Pause Exports
AllowTeleportPauses the movement checks so a scripted teleport is not flaggedBypass & Pause Exports
FlagPlayerReports your own detection and applies a punishmentCustom Flags & Trust
GetTrustScoreReturns the player's trust score and bandCustom Flags & Trust
IsActiveTells you whether the anticheat is running and licensedCustom Flags & Trust

GetEventGuardConfig and ReportEventAbuse are internal exports used by Event Guard and are not meant to be called from your scripts.

Features

Ban & Kick

Use it when your admin menu, Discord bot or job script should use the same ban list as CXA Anticheat instead of a separate one.

Example: Your admin menu has a Ban button. When it calls BanPlayer, the player gets a CXA ban ID such as CXA-7KQ2MX, sees the ban screen and is logged to your Bans webhook channel. From then on, CXA blocks the player on every join, just like an automatic ban. Read Ban & Kick Exports.

Bypass & Pause

Use it when one of your scripts does something on purpose that would look like cheating, such as a teleport, a cutscene or a character creator that hides the player.

Example: Your admin teleport script moves a player across the map. Calling AllowTeleport first pauses the movement checks for that player for a few seconds, so the teleport is not flagged. This is also the way to switch off one single detection for one player, because CXA has no per-detection bypass permission. Read Bypass & Pause Exports.

Custom Flags & Trust

Use it when your own scripts know that something is impossible, or when a feature should only be open to accounts the CXA network trusts.

Example: Your delivery job never pays more than a fixed amount. If a player's request asks for far more, your script refuses the payout and calls FlagPlayer, which logs the attempt like any other CXA detection. In the same way, a player market can check GetTrustScore and only allow sellers from the yellow band upwards. Read Custom Flags & Trust.

Recommendations

Good to Know

  • Check GetResourceState('cxa-anticheat') and IsActive() before you rely on an export, and wrap Lua calls in pcall.
  • Call exports only from server code that already validated the situation. Never let a client event decide alone whether a player gets paused or bypassed.
  • Detection keys and punishment values are case-sensitive. Copy them from All Detections.
  • Bans from BanPlayer and flags from FlagPlayer show up in the same webhook channels and panel tabs as CXA's own detections, so your staff see one history.

Staff Bypass

  • IsPlayerBypassed and RefreshBypass read the bypass rules from Staff Bypass.
  • Bypassed players skip every check, so FlagPlayer does nothing for them.

Bans & the CXA Network

  • Bans from BanPlayer use the same ban list as the panel and the cxaban command. See Bans & the CXA Network.
  • UnbanPlayer also withdraws the ban from the CXA network if it was shared there.

Logging & Discord

  • Bans and flags from exports are sent to your webhook channels and the panel's Detections tab. See Logging & Discord.

Common Problems

"No such export ... in resource cxa-anticheat"

What you see: Your script stops with No such export IsActive in resource cxa-anticheat (the export name changes with the call).

How to fix it:

  • Make sure cxa-anticheat is started. Put ensure cxa-anticheat above your own resource in server.cfg.
  • Check that you call the export from a server script. The exports do not exist on the client.
  • Check the spelling. Export names are case-sensitive: BanPlayer, not banPlayer.

The Export Returns false or Nothing

What you see: The call works, but it returns false or nil and nothing happens.

How to fix it:

  • Check IsActive(). BanPlayer and FlagPlayer return false while the anticheat is not running, and the ban list stays empty until it has started.
  • Check that the player is still online. Exports that take a server ID return false for players who already left.
  • In Lua, use a colon. A dot shifts every argument by one:
-- ❌ Dot: the player ID is swallowed, the call returns false
exports['cxa-anticheat'].KickPlayer(source, 'Reason')

-- ✅ Colon: the arguments arrive in the right order
exports['cxa-anticheat']:KickPlayer(source, 'Reason')

© 2026 CodeXart Studios · CXA Anticheat