☰ All guides
ESXQB-Core

6-antilag V1

The classic anti-lag: install with an item, hold a key, flames and bangs.

Resource folder

six_antilag

01Requirements

  • ESX (1.1, 1.2 or Legacy) or QB-Core
  • oxmysql

02Installation

  1. 01Sign in to the Cfx Portal with the account you bought with and download the script under Granted Assets.
  2. 02Unzip the download and move the folder six_antilag into the resources folder of your server. Keep the folder name and upload every file, including the hidden .fxap.
  3. 03ESX: run sql_esx.sql in your database. It creates the item antilag and the table antilag. QB-Core: run sql_qb.sql and copy the line from qb_item.txt into qb-core/shared/items.lua.
  4. 04QB-Core only: open fxmanifest.lua and remove the line '@es_extended/imports.lua'. That file does not exist on a QB server and causes an error at start.
  5. 05Open config.lua and set Config.framework to "esx" or "qb".
  6. 06Add ensure six_antilag to your server.cfg, below your framework and oxmysql.
  7. 07Restart the server (or run refresh and then ensure with the folder name in the server console).

Good to know

ox_inventory: items are not read from the database. Add the item to ox_inventory/data/items.lua instead: ['antilag'] = { label = 'Antilag System', weight = 100 },

03How players use it

  1. 01Use the item antilag inside a vehicle. The install takes 15 seconds by default.
  2. 02Hold SHIFT while the engine is in the RPM range. The exhaust shoots flames.
  3. 03Remove it with /antilagremove.

04Configuration

Option

Config.framework
"esx" or "qb".
Config.newESX
true for ESX Legacy (1.2 and newer, shared object via export). false for old ESX 1.1 (shared object via event). Ignored on QB.
AntiLag.hotkey
Control ID of the key. Default 21 (SHIFT).
AntiLag.item
Name of the install item.
AntiLag.removeCMD
Command to remove the system.
AntiLag.installationTime / deinstallationTime
Duration in milliseconds.
AntiLag.flameSize
Size of the flames.
Config.vehiclesTable
QB-Core only: vehicle table for the owner check.
Config.progressBars
true shows a progress bar through Config.progressBarstart and Config.progressBarstop. Put the export of your progress bar resource there.
Config.RPM
Function with the RPM range in which the antilag fires. Default 0.75 to 0.86.
Config.Notification
Function for notifications.
Config.Locals
All texts.
›config.luaComplete file · 58 lines
config.lua
Config = {}

Config.framework = "esx" -- esx or qb
Config.newESX = true -- Ignore if you are using QB Framework

Config.AntiLag = {
    hotkey = 21, -- SHIFT = 21
    item = "antilag",
    removeCMD = "antilagremove",

    installationTime = 15000,
    deinstallationTime = 5000,
    flameSize = 2.4,
}

Config.vehiclesTable = "player_vehicles"  -- Only for QBCore, change to your vehicles table name

Config.progressBars = false
Config.progressBarstart = function(text, time)
    exports['progressBar']:startUI(time, text) -- Your progress bar resource name (export must be set in manifest.lua)
end
Config.progressBarstop = function()
    exports['progressBar']:stopUI() -- Your progress bar resource name (export must be set in manifest.lua)
end

Config.RPM = function(RPM, pedVehicle, vehiclePos, BackFireDelay)
    if RPM > 0.75 and RPM < 0.86 then -- Change this value to your liking
        TriggerServerEvent("six:server:antilag:flames", VehToNet(pedVehicle), vehiclePos)
        Wait(BackFireDelay)
    end
end

Config.Notification = function(message, type, source)
    if Config.framework == "esx" then
        if type == "client" then
            ESX.ShowNotification(message)
        else
            TriggerClientEvent("esx:showNotification", source, message)
        end
    else
        if type == "client" then
            QBCore.Functions.Notify(message)
        else
            TriggerClientEvent("QBCore:Notify", source, message)
        end
    end
end

Config.Locals = {
    installProgress = "Installation of Antilag system",
    deinstallProgress = "Deinstallation of Antilag system",
    installtionAntilag = "You have successfully grown the Antilag System",
    deinstalltionAntilag = "You have successfully removed the Antilag System",
    alrInstalled = "An anti-lag system is already installed in this vehicle",
    notInstalled = "An anti-lag system is not installed in this vehicle",
    inVehicle = "You must be in a vehicle to install the antilag system",
    notOwner = "You are not the owner of this vehicle"
}

Good to know

Modified framework? Every framework call of this script sits in client/esx.lua, client/qb.lua, server/esx.lua and server/qb.lua. Adapt those files if your server uses renamed events or a custom inventory. They stay editable in the Locked version too.

05Troubleshooting

SQL error: table antilag doesn't exist

The SQL file was not imported. Run sql_esx.sql or sql_qb.sql.

With Config.progressBars = true the install hangs.

The export in Config.progressBarstart points to a resource called progressBar. Change it to the export of the progress bar you actually run.

06Still stuck?

Open a ticket on our Discord. Send the script name, your framework and version, and the full error from the server console (F8 for client errors). That saves a round of questions.