Developers
Spawning entities
Let your garages, jobs and scripts spawn vehicles, peds and objects without spawn detections.
Apex watches every networked entity that is created on your server. Spawns that come from your own scripts (garages, job vehicles, NPCs, props) are normally fine. If a specific spawn is flagged, whitelist it with apexAllowSpawn before you create it.
lua
-- server-side, BEFORE the entity is created
exports['ApexAC']:apexAllowSpawn(source, `adder`, 30000)
Signature#
lua
exports['ApexAC']:apexAllowSpawn(playerId, model, durationMs)
TriggerEvent('apex:det:allowSpawn', playerId, model, durationMs)
| Parameter | Type | Description |
|---|---|---|
playerId |
number | The player that will own / spawn the entity. |
model |
string or number | Model name ('adder') or hash (`adder`). |
durationMs |
number | How long the whitelist lasts. Default 30000. |
Example: garage#
lua
RegisterNetEvent('mygarage:takeOut', function(plate)
local src = source
local veh = getOwnedVehicle(src, plate) -- your own check
if not veh then return end
exports['ApexAC']:apexAllowSpawn(src, veh.model, 30000)
TriggerClientEvent('mygarage:spawn', src, veh) -- client spawns it
end)
What it does not cover#
Spawn spam, troll models and copies of players are still blocked — no legit script needs those.
Blocked model lists#
In the dashboard you can block specific models for Vehicle spawn, Ped spawn and Object detections (one model name or hash per line). See Detection settings.
Generic server exemption#
lua
exports['ApexAC']:apexSrvExempt(source, 'antiVehicleSpawn', 10000)
This only works for the three spawn detections (antiVehicleSpawn, antiPedSpawn, antiObject). For everything else use allow.
Apex