Skip to Content
TC KeysHotwire & Lockpick

Hotwire & Lockpick System

Interactive minigames for breaking into vehicles and doors.

Overview

tc_keys includes two criminal mechanics:

  • Hotwire - Start a vehicle without keys
  • Lockpick - Open locked doors and vehicles

Both feature interactive minigames with configurable difficulty and police dispatch integration.

Hotwiring Vehicles

How to Hotwire

Requirements:

  • hotwire_kit item (configurable)
  • Must be in driver seat
  • Must not have vehicle access already

Steps:

  1. Sit in the driver seat of a locked vehicle
  2. Use the hotwire kit item
  3. Complete the hotwire minigame
  4. On success: Engine starts, vehicle unlocked
  5. On failure: Remain locked, possible police alert

Hotwire Minigame

The hotwire minigame requires players to connect wires while avoiding sparks:

Gameplay:

  • Multiple wires appear on screen
  • Click and hold each wire to connect it
  • Sparks randomly travel along wires
  • Release before a spark reaches you
  • Connect all wires to succeed

Difficulty Levels:

  • Easy (C Class) - Fewer wires, slower sparks
  • Medium (B Class) - Moderate wires and sparks
  • Hard (A Class) - More wires, faster sparks
  • Very Hard (S Class) - Many wires, very fast sparks

✅ Tip: Keep your finger ready to release when you see sparks approaching!

Difficulty Configuration

Configure how difficulty is determined:

Config.HotWireDifficulty = "auto" -- "auto", "easy", "medium", "hard"

Auto Mode (Recommended):

Config.GetVehicleClass = function(speed, vehicleName) if speed >= 160.0 then return "S" -- Supercars elseif speed >= 140.0 then return "A" -- Sports cars elseif speed >= 120.0 then return "B" -- Performance cars else return "C" -- Regular cars end end

Custom Logic Examples:

-- By vehicle class Config.GetVehicleClass = function(speed, vehicleName) if vehicleName:find("supercar") then return "S" end -- etc. end -- By vehicle model hash Config.GetVehicleClass = function(speed, vehicleName) local difficultVehicles = { ["adder"] = "S", ["zentorno"] = "S", -- etc. } return difficultVehicles[vehicleName] or "C" end

Lockpicking

Lockpicking Vehicles

Requirements:

  • lockpick item (configurable)
  • Must be outside the vehicle
  • Vehicle must be locked
  • Must be within 2.5 meters

Steps:

  1. Stand near a locked vehicle
  2. Use the lockpick item
  3. Complete the lockpick minigame
  4. On success: Vehicle unlocked (temporarily)
  5. On failure: Remain locked, possible police alert

Lockpicking Doors

Requirements:

  • lockpick item (configurable)
  • Door must be locked
  • Door must be lockpickable
  • Must be within 5 meters

Steps:

  1. Stand near a locked door
  2. Use the lockpick item
  3. Complete the lockpick minigame (difficulty based on door config)
  4. On success: Door unlocked (temporarily)
  5. On failure: Remain locked, possible police alert

Lockpick Minigame

The lockpick minigame requires precise timing:

Gameplay:

  • A slider moves up and down
  • A target zone is shown
  • Click when the slider is in the target zone
  • Complete multiple rounds to succeed

Difficulty Levels:

  • Easy - Large target zone, slow speed
  • Medium - Medium target zone, medium speed
  • Hard - Small target zone, fast speed

✅ Tip: Watch the slider’s movement pattern before clicking.

Smart Detection: When you use a lockpick item, the system automatically:

  1. First checks for a nearby locked vehicle (within 2.5m)
    • If found: Starts vehicle lockpick minigame
  2. If no vehicle found: Checks for a nearby locked door (within 5m)
    • If found: Starts door lockpick minigame
  3. If neither found: Shows an error message

💭 Note: Lockpick items are typically consumed on use (server configurable).

Temporary Access

Both hotwire and lockpick grant temporary access:

Vehicle Access

  • Hotwire Success - Engine starts, can drive away
  • Lockpick Success - Doors unlock, can enter

Door Access

  • Lockpick Success - Door unlocks temporarily
  • Auto-Lock - Door re-locks after configured delay

Configure auto-lock delay:

Config.DoorAutoLockDelayMs = 5000 -- 5 seconds

⚠️ Important: Temporary access does NOT give permanent keys. For doors, they re-lock automatically.

Police Dispatch Integration

Both mechanics can trigger police alerts:

Configuration

Config.AlertPolice = true Config.PoliceAlertsChances = { hotwireFail = 0.5, -- 50% chance on failed hotwire lockpickFail = 0.5, -- 50% chance on failed lockpick lockpickSuccess = 0.2, -- 20% chance on successful lockpick hotwireSuccess = 0.2 -- 20% chance on successful hotwire }

Dispatch Messages

Dispatch alerts include:

  • Location - Coordinates where the crime occurred
  • Type - “Vehicle Hotwiring”, “Door Break-in”, “Vehicle Break-in”
  • Job - Sent to configured police jobs

💭 Note: Dispatch system is configured in tc_lib. Supports ps-dispatch, codesign-dispatch, and default notification.

Realistic Balancing

Success vs Failure Alerts:

  • Failed attempts have higher alert chance (caught in the act)
  • Successful attempts have lower alert chance (quiet professional)
  • Balances realism with gameplay

Recommended Settings:

  • High-security servers: Increase all chances
  • Roleplay servers: Keep defaults
  • Casual servers: Decrease or disable alerts

Item Consumption

Configure if items are consumed:

In Your Inventory Config

-- For ox_inventory ['lockpick'] = { label = 'Lockpick', weight = 160, server = {export = 'tc_lib.useItem'}, -- Consume on use (handled by inventory) } ['hotwire_kit'] = { label = 'Hotwire Kit', weight = 1, stack = false, server = {export = "tc_lib.useItem"}, -- Consume on use (handled by inventory) }

✅ Tip: Make lockpicks consumable and hotwire kits rare to balance the criminal economy.

Special Features

Job-Based Access

Some servers may allow mechanics or other jobs to hotwire vehicles without needing items, or with different difficulty settings.

Skill Systems

Your server may integrate skill progression:

  • Higher lockpicking skill = easier minigame
  • More experience = better success rate
  • Skill levels affect difficulty automatically

Custom Scenarios

Servers can create special scenarios:

  • Heist missions with specific lockpick requirements
  • Repo jobs requiring hotwiring
  • Training courses for learning the mechanics

Tips & Best Practices

For Server Owners

  1. Balance difficulty - Too easy removes risk, too hard frustrates players
  2. Set appropriate alert chances - Higher for high-security areas
  3. Make items valuable - Rare hotwire kits create interesting choices
  4. Consider your police population - More cops = higher alert chances work
  5. Test the minigames - Make sure they’re achievable

For Players

  1. Practice makes perfect - Try the minigames on test vehicles/doors
  2. Watch for police - High alert areas are risky
  3. Be quick - Don’t linger after successful lockpick
  4. Have backup items - Bring extra lockpicks
  5. Know when to run - Failed attempts might alert police

For Developers

  1. Use exports for custom items - Don’t duplicate the minigame code
  2. Respect item consumption - Don’t bypass item requirements
  3. Add skill progression - Integrate with your skill systems
  4. Create interesting scenarios - Heists, repo missions, etc.
  5. Balance rewards - Make risk worth the reward
Last updated on