Kartik Scripts

Electronics (TCS & ESC)

📄 Config file: shared/electronics_config.lua

Kartik-Mechanic includes built-in Traction Control System (TCS) and Electronic Stability Control (ESC) to help players manage high-performance vehicles. These systems are physical simulations that interact with the vehicle's handling dynamics.

Traction Control System (TCS)

TCS monitors wheel slip and automatically cuts engine power to regain traction.

  • Keybind: Define the default key to toggle TCS (Default: T)
  • Modifier: Define a modifier key that must be held down (Default: LALT)
  • Threshold: The percentage of slip allowed before TCS kicks in (Default: 0.15 or 15% slip).

Electronic Stability Control (ESC)

ESC detects loss of steering control (yaw rate) and selectively applies brakes to individual wheels to help "steer" the vehicle where the driver intends to go.

  • Keybind: Define the default key to toggle ESC (Default: E)
  • Modifier: Define a modifier key (Default: LALT)
  • Yaw Threshold: How much lateral yaw is allowed before ESC applies corrective braking (Default: 0.5).

Vehicle Whitelist and Blacklist

You can specify exactly which vehicles have access to the TCS and ESC systems.

Config.Electronics = {
    -- Enables TCS/ESC for entire vehicle classes (e.g. Coupes, Supers)
    EnabledClasses = {
        [0] = true, -- Compacts
        [1] = true, -- Sedans
        [2] = true, -- SUVs
        [3] = true, -- Coupes
        [4] = true, -- Muscle
        [5] = true, -- Sports Classics
        [6] = true, -- Sports
        [7] = true, -- Super
        -- [8] = false, -- Motorcycles
        [9] = true, -- Off-road
        [10] = true, -- Vans
        [11] = true, -- Utility
        [12] = true, -- Subs
        [17] = true, -- Service
        [18] = true, -- Emergency
    },
    
    -- Disables TCS/ESC for specific vehicle spawn models
    DisabledModels = {
        -- [`zentorno`] = true,
    }
}

HUD Integration
When players toggle TCS or ESC via the keybinds, the status indicators on the Mechanic HUD will light up green/red to indicate the current state of the systems.

On this page