Allow legit actions
Give armour, heal, teleport or grant godmode from your own scripts without triggering a detection.
When one of your scripts legitimately gives a player armour, heals them, teleports them or makes them invincible, call allow first. Apex then ignores the matching detections for that player for a short time.
-- server-side
exports['ApexAC']:allow(source, 'armour', 5000)
SetPedArmour(GetPlayerPed(source), 100)
Signature#
exports['ApexAC']:allow(playerId, kind, durationMs) --> boolean
TriggerEvent('apex:allow', playerId, kind, durationMs)
| Parameter | Type | Description |
|---|---|---|
playerId |
number | Server ID of the player (source). |
kind |
string | A group from the table below, or an exact detection name such as 'antiArmor'. Case-insensitive for groups. |
durationMs |
number | How long the exemption lasts. Default 5000, minimum 500, maximum 600000 (10 minutes). |
Returns true when the exemption was set, false for an unknown player or unknown kind.
Groups#
kind |
Detections that are ignored |
|---|---|
armour / armor |
antiArmor |
health |
antiHealth, antiOverrideHealthStats |
heal / revive |
antiHealth, antiArmor, antiGodmode, antiOverrideHealthStats, antiSemiGodmode |
teleport |
antiTeleport, antiTeleportToWaypoint, antiNoclip, antiTeleportInVehicle, antiUndermap |
noclip |
noclip, teleport, freecam, speed, super jump, fly/swim, undermap, invisible, ragdoll and godmode checks |
godmode |
antiGodmode, antiSemiGodmode, antiHealth, antiNoRagdoll, antiOverrideHealthStats, antiArmor, antiRagdoll, antiNoCombatDamage |
invisible |
antiInvisible, antiInvisibleWitness |
freeze |
antiInputBlock, antiNoSync |
model |
antiPedModelChange, antiPed, antiHeadlessPed, antiModifiedHitbox |
weapons |
weapon spawn / give / ammo checks |
spawn |
vehicle, ped and object spawn checks (prefer apexAllowSpawn for spawns) |
speed |
antiSpeedHack, antiNoclip, antiFlySwim |
Any detection name works too, for example allow(source, 'antiSuperJump', 3000). See the detection list for every name.
Examples#
Armour vest item#
-- server.lua
RegisterNetEvent('myitems:useVest', function()
local src = source
if not hasItem(src, 'armour_vest') then return end -- your own check
removeItem(src, 'armour_vest')
exports['ApexAC']:allow(src, 'armour', 5000)
SetPedArmour(GetPlayerPed(src), 100)
end)
If your inventory sets armour client-side, call allow on the server right before you tell the client to apply it:
exports['ApexAC']:allow(src, 'armour', 5000)
TriggerClientEvent('myitems:applyArmour', src, 100)
Medkit / ambulance revive#
exports['ApexAC']:allow(src, 'heal', 8000)
TriggerClientEvent('esx_ambulancejob:revive', src)
Why this matters
To Apex, a script heal looks exactly like a heal cheat, and antiHealth bans by default. Always call allow before your script heals or revives someone.
Teleport (apartments, garages, elevators)#
exports['ApexAC']:allow(src, 'teleport', 4000)
SetEntityCoords(GetPlayerPed(src), x, y, z)
Call it for every scripted teleport (apartments, garages, elevators, interiors).
Admin menu godmode / noclip (non-Apex menu)#
-- while the admin has it switched on, refresh every few seconds
exports['ApexAC']:allow(src, 'noclip', 5000)
The Apex in-game panel does this automatically for its own tools. Only third-party admin menus need it.
Good practice#
- Call
allowright before the action, with the shortest duration that works (a few seconds). - Do your own checks (item, job, money, permission) on the server before calling it.
- Never call it from a handler that any client can trigger without checks.
Apex