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)))// Dot syntax: exports['resource'].ExportName(...)
const active: boolean = exports['cxa-anticheat'].IsActive();
console.log(`CXA Anticheat active: ${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// Returns true when cxa-anticheat is started and protecting the server
function cxaReady(): boolean {
if (GetResourceState('cxa-anticheat') !== 'started') return false;
try {
return exports['cxa-anticheat'].IsActive() === true;
} catch {
return false;
}
}In server.cfg, put ensure cxa-anticheat above the resources that call these exports, so the exports exist when your scripts start.
Overview
| Export | What it does | Page |
|---|---|---|
BanPlayer | Bans an online player with a CXA ban ID and drops them with the ban screen | Ban & Kick Exports |
KickPlayer | Drops an online player with the kick screen | Ban & Kick Exports |
UnbanPlayer | Removes an active ban by its ban ID | Ban & Kick Exports |
GetBan | Returns the record of an active ban | Ban & Kick Exports |
IsIdentifierBanned | Checks whether an identifier or hardware token is banned | Ban & Kick Exports |
IsPlayerBypassed | Tells you whether a player skips every check | Bypass & Pause Exports |
RefreshBypass | Recalculates a player's bypass after you changed their group | Bypass & Pause Exports |
SetTemporaryBypass | Pauses every detection for one player for a number of seconds | Bypass & Pause Exports |
PauseDetection | Pauses one detection, or a group of detections, for one player | Bypass & Pause Exports |
AllowTeleport | Pauses the movement checks so a scripted teleport is not flagged | Bypass & Pause Exports |
FlagPlayer | Reports your own detection and applies a punishment | Custom Flags & Trust |
GetTrustScore | Returns the player's trust score and band | Custom Flags & Trust |
IsActive | Tells you whether the anticheat is running and licensed | Custom 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')andIsActive()before you rely on an export, and wrap Lua calls inpcall. - 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
BanPlayerand flags fromFlagPlayershow up in the same webhook channels and panel tabs as CXA's own detections, so your staff see one history.
Related Features
Staff Bypass
IsPlayerBypassedandRefreshBypassread the bypass rules from Staff Bypass.- Bypassed players skip every check, so
FlagPlayerdoes nothing for them.
Bans & the CXA Network
- Bans from
BanPlayeruse the same ban list as the panel and thecxabancommand. See Bans & the CXA Network. UnbanPlayeralso 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-anticheatis started. Putensure cxa-anticheatabove your own resource inserver.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, notbanPlayer.
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().BanPlayerandFlagPlayerreturnfalsewhile 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
falsefor 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')// ❌ Colon syntax does not exist in TypeScript
// exports['cxa-anticheat']:KickPlayer(source, 'Reason');
// ✅ Dot syntax
exports['cxa-anticheat'].KickPlayer(source, 'Reason');© 2026 CodeXart Studios · CXA Anticheat