Config & Performance

This page explains the tosun-ac/configs/anticheat_config.lua settings. For each one: what it protects, performance impact and recommended value.

Rule of thumb: raising an ms/sec value = less CPU/DB load (panel updates slightly later). Lowering it = faster reaction but more load. Keep every action on "log" for the first week to tune false-positives, then move to "kick"/"ban".

Performance budget — what costs what

FeatureCostWeight
LiveWatch (live screen/video)Client capture + network + DB🔴 High
ResourceGuard.deepScanServer CPU (hash every .lua/.js)🔴 High
BackdoorGuard / signatureScanPeriodic CPU + disk🟠 Medium
v12 VPN checkExternal API on connect (cached)🟡 Low
Detections (client loop)Player machine CPU🟢 Very low

LiveWatch — the heaviest feature

ts.LiveWatch.interval (1500ms ≈ 6.7 FPS): lower value = much more network+CPU. Recommended: 1500 with tosun_render, 2500–3000 with screenshot-basic. quality 0.7 is ideal; maxConcurrent 3 for small servers, 5–8 for large.

ServerPerf — lag / hitch reduction

SettingDefaultRecommended
panelPlayerSyncIntervalMs1200012000 (large server 15–20k)
liveWatchDbPollMs45004500
configSyncIntervalSec120120 (never <60 — overflow risk)

Guards (server CPU)

  • ResourceGuard.deepScan = false (when on, every file is hashed; heavy — enable only during an audit).
  • ResourceGuard.resyncInterval 90000 — lowering means frequent hashing.
  • BackdoorGuard.scanIntervalMs 1800000 (30m); use 3600000 on large servers, 0 = boot only.
  • BackdoorGuard.autoQuarantine = false (a false-positive could stop a legit resource; review in the panel first).
  • EventScanner.scanIntervalMs 3600000 (1h) — low cost.

Detections

Detections run on the player's client → almost no server load, very low client CPU. Keep them all on; the only risk is false-positives. Use ts.confirmHits to confirm a detection 2–3 times before banning (greatly reduces FP, no perf cost).

v12 (VPN / cleanup / heartbeat)

  • enableVpnCheck = true (catches ban-evasion; external API on connect, 3s timeout, 24h cache).
  • blockHosting = false recommended (VPS/staff false-positives).
  • keepDetectionsDays 90 — use 30–60 on busy servers to keep the table small.
Quick recommendations
  • Lag? → raise ServerPerf values, raise LiveWatch.interval, deepScan=false, raise BackdoorGuard interval.
  • Maximum security? → all actions kick/ban, autoBlockInfected/autoQuarantine as pilot, launcherGate (if you ship a launcher).
  • Always: "log" for the first week, enable confirmHits, manage blacklist/whitelist from the panel, Debug=false.

Nearly every setting is explained one-by-one below.

A) Core settings

SettingDefaultDescription / Recommendation
DebugfalseDeveloper logs — false in production
Locale"tr"Language (tr/en/de/fr/es/pt/ru/zh)
punishTypeBANDefault punishment: LOG / KICK / BAN
banIDFormat11=ABCD-1234, 2=#1234
autoSQLfalseCreate tables on first boot → then false
showReasontrueShow ban reason to player
spoilerIPtrueHide IP in logs (privacy)
needDiscordfalseRequire Discord link on join
maxUsernameLength-1-1 = unlimited
txAdminAuthtrueRecognize txAdmin admin perms
NuiNeverBanUnauthorizedtrueUnauthorized NUI → log only (no ban)
screenshotModulescreenshot-basicScreenshot source (tosun_render smoother)

B) Detections — full list (keep all on, ~no perf)

All run on the player's client; no server load. Risk is false-positives → first week punishType="LOG", confirmHits on.

Aim / Combat

antiAimbot / antiSilentAimAuto / silent aim
antiInstantAim / antiMicroJitter / antiGimbalLookAim snap / micro-jitter / 360° look
antiSpoofedShot / antiBulletTracerFake shot / bullet origin
antiNoRecoil / antiRapidFire / antiMagicBulletNo-recoil / rapid fire / wall-bang
antiInfiniteAmmo / antiExplosiveAmmoInfinite / explosive ammo
antiDamageBoost / antiWeaponDamageBoost / antiDamageModDamage multiplier (cap weaponDamageMultMax 1.10)
antiMeleeDamageBoost / antiMeleeDefenseBoostMelee damage/defense (1.08/1.12)
antiThermal / antiNightVision / antiRadarThermal/NV/radar (radar off by default)
antiVDM / antiKill / antiTazeVDM / unauthorized kill / taze grief

Movement / Body

antiGodMode / antiPlayerInvincibleInvincibility
antiNoClip / antiVehicleNoClipNo-clip (noclipHeightMin 3m, noclipFlatSpeedMin 3 m/s)
antiTeleport / antiTeleportInVehTeleport (teleportDistance 0=auto, veh 90m)
antiFastRun / antiOnFootSpeedHack / antiSprintHackSpeed (onFootSpeedMax 12 m/s, runSprintMultMax 1.15)
antiSpeedHackVehicle speed + handling
antiSuperJump / antiInfiniteRollSuper jump / infinite roll
antiInfiniteStamina / antiStaminaRecoveryHack / antiSwimMultHackStamina/swim multipliers
antiHealthRegenSpike / antiArmorRegenSpikeHP/armor spike (55 / 65 per sec)
antiIllegalExtraHealth / antiIllegalExtraArmorCap breach (200 / 100)
antiInvisible / antiSmallPed / antiPedSwapInvisibility / small ped / ped swap
antiFreeCam / antiSpectate / antiBlipsFreecam/spectate/blip ESP (freecamMaxDistance 45m)

Vehicle

antiVehicleGodmode / antiVehicleHealthHackVeh invincibility/HP (vehHealthCapMax 1100)
antiVehicleTopSpeedMod / antiVehCheatPowerTop-speed/engine power (1.10 / 1.12)
antiVehiclePlayerDmgBoost / antiVehicleDefenseBoostVeh damage/defense multiplier
antiVehicleGravityAbuseGravity abuse (0.35–16.0)
antiBlacklistedVehicles / ...SpawnBlacklisted vehicle / spawn
antiBlacklistPlate / antiPlateChangeBlacklisted plate / plate change

Spawn / Entity / Visual

antiEntitySpawn / antiSpamPed / antiPeds / antiAIsMass vehicle/object/ped spawn
antiBlacklistedWeapon / antiGiveWeapons / antiRemoveWeaponsBlacklisted/unauthorized weapons
antiObjectAttach / antiAttachChainAbuseObject attach abuse (chain depth 4)
antiExplosionBlacklist / antiExplosiveAmmoExplosion blacklist
antiOverlay / antiMenus / antiNUIDevToolsOverlay / mod menu / NUI DevTools
antiPickups / antiClipboardPasteOFF by default (privacy/FP)

System / Integrity

antiResourceInjection / antiResourceClone / antiCustomNativeRuntime injection / manifest clone / native hook
antiFileTampering / antiCipherBypass / antiHWIDSpoofFile tampering / cipher spoof / HWID change
antiResourceStop / antiResourceStart / antiModuleStopUnauthorized resource/module stop-start
antiStatebagCrash / antiServerEventSpam / antiCommandSpamStatebag crash / event-command spam
antiClearTasks / BlacklistedTasks / antiFoldClearTasks abuse / blacklisted task
fakeTriggers / messageBlacklistHoneypot fake event / banned chat+OCR
antiLowFPSMacroLow-FPS macro (lowFPSThreshold 6)

C) Thresholds / tolerances (false-positive tuning)

confirmHits (noclip 3, teleport 3, fastrun 2…)Confirm N times before banning — greatly reduces FP
spawnGraceSecondsMs 35000No-detection window after spawn
noclipStrikeMax 3 / fakeTriggerStrikeMax 2Consecutive-hit tolerance
instantAimDegPerFrame 75 / gimbalLookDegPerFrame 270Aim/look angle thresholds (raise = less FP)
maximumModifier 2.0Global multiplier cap

D) System blocks (action: log→kick→ban)

BlockWhat it does / Recommendation
shieldNative hooks + hidden NUI fingerprint/heartbeat + WebGL screenshot/video evidence on ban. nuiHeartbeatAction "log" first
nativeGuardExternal tosun-guard.exe RAM/memory scan. action "log"→"kick", requireGuard true if you ship guard
shieldAiObject/vehicle/ped AI spawn rate-limit (maxVehiclePerSec 4). action "cancel"
shieldExplosionInvisible/inaudible explosion block (action "ban")
premiumGuardParticle/projectile/sound/ragdoll/requestControl guard + rate-limit. All "log" first
guard (watchdog)Separate tosun-guard resource liveness. action "log" (no FP if guard absent)
v16 serverMovementServer-side teleport (teleportSpeedFlag 150 m/s, action "log")
cloudBridgeThreat-score + central threat-intel lookup (threatIntelMinScore 70, "log")
launcherGateLauncher-only join — keep false unless you ship a launcher
licenseLockProduct license lock — "log" then "reject" in production
Framework.moneyCheckMoney cheat (moneyCheckThreshold 5M hard, moneySoftThreshold 75k soft)
PhoneNotify / connectingCard / AdminMenuPhone alerts / connect card / admin menu

E) Preset bundles

ScenarioRecommended
RP server (balanced)All action = "log" (first week) → then "kick"; confirmHits on; blockHosting=false; LiveWatch on; launcherGate=false
Hardcore / PvPactions "ban"; nativeGuard.action="kick"; shieldExplosion="ban"; tighten thresholds; premiumGuard "kick"
Low-RAM / VPSdeepScan=false; LiveWatch.interval 3000; raise ServerPerf values; BackdoorGuard.scanIntervalMs 3600000; keepDetectionsDays 30
Maximum securitylauncherGate=true (if you ship a launcher); requireGuard=true; autoBlockInfected/autoQuarantine pilot; all actions "ban"; licenseLock "reject"

F) Reducing false-bans

  • First week punishType="LOG" + every block action="log" — watch real players and tune.
  • Use ts.confirmHits to confirm a detection 2–3 times before banning.
  • Loosen thresholds: raise instantAimDegPerFrame, maxVehicleTeleportDistance, onFootSpeedMax, etc.
  • Permanent exemption: panel → AC → Whitelist. For temporary/activity-based exemption use exports:
exports['tosun-ac']:AddWhitelist("license:abc", 3600)   -- exempt 1 hour
exports['tosun-ac']:WhitelistArea(src, "parkour", 120)  -- during an activity
exports['tosun-ac']:BypassDetection(src, {"antiTeleport","antiFastRun"}, 8000)
exports['tosun-ac']:SetPlayerExempt(src, true, 60000, "clothing")

G) Troubleshooting

SymptomFix
AC won't connect (red heartbeat)Is panel ac_api_key = FiveM webPanelKey? Is fivem_url the game server address (not the web panel)? Is tosun-ac started?
Players can't joinSet launcherGate.enabled=false (if no launcher); raise firstHeartbeatDeadline (heavy servers); if VPN set blockHosting=false
Lag / hitchRaise ServerPerf values; raise LiveWatch.interval; ResourceGuard.deepScan=false; raise BackdoorGuard.scanIntervalMs
Staff/VPS false VPN-banbypassStaffIpCheck=true; blockHosting=false; add staff to AdminBypassIdentifiers
Legit player banned (FP)Set that action="log"; raise confirmHits; loosen threshold; exempt via export
Reliable network overflow errorDon't lower NetworkJoin values; keep configSyncIntervalSec ≥ 60

Full list of all detection keys and panel on/off: panel → AC Settings.

Back to home Tosun Dev Docs