⚙️Configuration

Overview

The Traffic Lights Hacking system is configured entirely through the config.lua file. This guide covers all available configuration options in detail.

Traffic Light Models

Define which traffic light models can be hacked:

Config.LightModels = {
    [1] = -655644382,  -- Standard traffic light model
    [2] = 862871082,   -- Alternative traffic light model
}

Configuration Tips:

  • These are GTA V model hashes for traffic light props

  • Add more model hashes if your server uses custom traffic light props

  • Find model hashes using developer tools or object viewers

Police Requirements

Configure police requirements for hacking traffic lights:

Config.PoliceSettings = {
    enabled = false,  -- Enable/disable police requirement
    reqAmount = 1,  -- Minimum police needed online
    Notify = 'Not enough police on to do this',  -- Notification message
    PoliceJobs = {
        'police'  -- List of police job names
    }
}

Configuration Options:

  • enabled - true to require police, false to allow hacking anytime

  • reqAmount - Minimum number of online police officers required

  • Notify - Message shown when not enough police are online

  • PoliceJobs - Array of job names that count as police

Example with Multiple Police Jobs:

Progress Bar Settings

Configure the initial preparation phase:

Configuration Options:

  • timer - How long the preparation takes (in seconds)

  • title - Text shown on progress bar

  • description - Additional description text

Customization Examples:

Dispatch Settings

Configure police dispatch notifications:

Configuration Options:

  • title - Dispatch call title

  • description - Dispatch call description

  • jobType - Which job type receives the dispatch

  • urgency - Urgency level

Customization Examples:

Hacking Configuration

Configure the core hacking mechanics:

Configuration Options:

Item Settings

  • requireditem - Item name from your inventory system

  • requireditemamount - How many items needed (usually 1)

  • takeitem - true to enable consumption chance, false to never consume

  • takeitemchance - Percentage chance (0-100) to consume the item on use

Item Configuration Examples:

Minigame Settings

  • timer - Time limit per minigame round (in seconds)

  • difficulty - How hard the minigame is (1-10 scale)

    • 1-3: Easy (more time, fewer requirements)

    • 4-6: Medium (balanced)

    • 7-10: Hard (less time, more requirements)

Difficulty Examples:

Important: Players must complete 3-5 rounds (randomly chosen) of the minigame. Each round uses the same difficulty settings.

Notification Settings

  • CompleteNotifyMsg - Success message

  • CompleteNotifyDoneAlready - Message when traffic light already hacked

  • CompleteNotifyStatus - Notification type ('success', 'info', 'error', 'warning')

  • CompleteNotifyTimer - How long notification shows (milliseconds)

Reward System

The script supports three types of rewards: Items, Cryptocurrency, and Reputation.

Reward Notifications

Set to false to disable reward notifications.

Reward Tiers

Each reward type has three tiers based on random chance:

  • lowtier - Common rewards, easier to get

  • mediumtier - Uncommon rewards, moderate chance

  • hightier - Rare rewards, low chance

Item Rewards

Configuration Options:

  • enabled - Enable/disable this reward type

  • item - Item name from your inventory system

  • amount - How many of the item to give

  • chance - Percentage chance (0-100) to receive this item

Adding More Rewards:

Cryptocurrency Rewards

Configuration Options:

  • Enabled - Enable/disable crypto rewards

  • type - Cryptocurrency type name from your framework

  • amount - Amount of crypto to give

  • chance - Percentage chance to receive

Using Different Crypto:

Reputation Rewards

Configuration Options:

  • Enabled - Enable/disable reputation rewards

  • Reptype - Reputation category from your framework

  • amount - Amount of reputation to add

  • chance - Percentage chance to receive

Multiple Reputation Types:

Reward Chances System

Configure the probability of receiving each reward tier.

Basic Chance System (No Luck)

How It Works:

  1. System rolls a random number 1-100

  2. If roll ≤ hightier value (35) → Player gets hightier rewards

  3. Else if roll ≤ mediumtier value (50) → Player gets mediumtier rewards

  4. Else if roll ≤ lowtier value (80) → Player gets lowtier rewards

  5. Otherwise → No rewards from this tier system

Tuning Examples:

Luck-Based Rewards (Optional)

Enable luck-based reward scaling for players with luck status effects:

Configuration Options:

  • LuckEnabled - true to use luck-based scaling, false to always use NoLuck values

  • [25], [50], [75], [100] - Luck level breakpoints

How Luck Works:

  • Requires the statuseffects resource to be running

  • Players gain luck from consumables or other game mechanics

  • Higher luck = better chance at higher tier rewards

  • System checks player's luck value and uses appropriate tier chances

Disabling Luck for Specific Rewards:

Electrocution System

Configure the electrocution mechanic that can occur when hacking:

How It Works:

  • Tracks how many traffic lights each player has hacked

  • When player reaches the amount threshold, rolls for electrocution

  • If electrocution occurs, player is stunned briefly

Configuration Examples:

Note: The amount field appears to track in memory but actual implementation uses a different trigger (on minigame failure). The electrocution primarily triggers when a player fails the hacking minigame.

Complete Configuration Example

Here's a fully configured example balancing difficulty and rewards:

Next Steps

After configuring your traffic lights hacking system, check out the FAQ for common questions and troubleshooting tips, or return to Installation for setup instructions.

Last updated