Skip to Content
TC KeysDoor Locks

Door Lock System

The door lock system allows you to create and manage locked doors with multiple access methods.

Creating Door Locks

Using In-Game Creator

The easiest way to create door locks is using the built-in UI:

  1. Open the door locks UI (use a command or keybind configured by your server)

  2. Click “Create new door lock”

  3. Click “Pick door in world” - the UI will close

  4. For Single Door:

    • Aim at the door and left-click to select it
    • The door will turn green when selected
    • Right-click to confirm
  5. For Double Door:

    • Aim at the first door and left-click
    • The first door will turn green
    • Aim at the second door and left-click
    • Right-click to confirm both doors
  6. Configure the door lock settings:

    • Name - A descriptive name for the door
    • Lockpick Difficulty - Easy, Medium, Hard, or Not Lockpickable
    • Access Type - Key, Keypad, or Fingerprint
    • Job Access - (Optional) Configure job-based access
  7. Click “Create” to save the door lock

✅ Tip: You can edit existing door locks by clicking the “Edit” button in the door locks list.

Access Types

Physical Key Access

The default access method. Players need a physical key item to unlock the door.

  • Key item: door_key (configurable in config.lua)
  • Each key has metadata linking it to a specific door
  • Use server exports to give/remove keys

Keypad Access

Players enter a code on a keypad to unlock the door.

  1. Select “Keypad” as access type
  2. Set a keypad code (numeric)
  3. Click “Pick keypad location”
  4. Aim at a wall/surface near the door and left-click
  5. A keypad prop will appear at that location

How players use it:

  • Walk up to the keypad
  • A prompt will appear to enter the code
  • Enter the correct code to unlock the door
  • Door auto-locks after the configured delay

Fingerprint Scanner Access

Players with the correct door key or job access can use the fingerprint scanner.

  1. Select “Fingerprint” as access type
  2. Click “Pick fingerprint location”
  3. Aim at a wall/surface near the door and left-click
  4. A fingerprint scanner prop will appear at that location

How players use it:

  • Walk up to the scanner
  • A prompt will appear to scan fingerprint
  • If they have a key or job access, the door unlocks
  • Door auto-locks after the configured delay

💭 Note: Fingerprint scanners validate access against keys and job access lists.

Job-Based Access

Configure which jobs can access a door:

  1. In the door lock creator/editor, scroll to “Access by job”
  2. Click “Add job”
  3. Enter the job name (e.g., “police”)
  4. Choose grade requirements:
    • All grades - Any player with this job
    • Specific grades - Only players with certain grades
  5. Add multiple jobs if needed

Job Key System:

  • Players need a Job Key item to use job-based access
  • Job keys are given via NPC key dispensers (see Job Keys page)
  • Each door can have different grade requirements
  • Players are validated per-door based on their current job/grade

⚠️ Important: Job-based access requires players to have both the correct job/grade AND a job key item.

Lockpick Difficulty

Configure how difficult it is to lockpick each door:

  • Easy - Simple lockpick minigame
  • Medium - Moderate lockpick minigame
  • Hard - Difficult lockpick minigame
  • Not Lockpickable - Cannot be lockpicked

✅ Tip: High-security areas should be set to “Not Lockpickable” or use fingerprint scanners with job access.

Auto-Lock Feature

Doors automatically re-lock after temporary access:

  • Keypad access: Door auto-locks after configured delay
  • Fingerprint access: Door auto-locks after configured delay
  • Lockpick success: Door auto-locks after configured delay
  • Manual toggle with key: No auto-lock

Configure the delay in config.lua:

Config.DoorAutoLockDelayMs = 5000 -- 5 seconds

Managing Door Locks

Editing Door Locks

  1. Open the door locks UI
  2. Find the door in the list
  3. Click “Edit”
  4. Make your changes
  5. Click “Save”

Deleting Door Locks

  1. Open the door locks UI
  2. Find the door in the list
  3. Click “Remove door lock”
  4. Confirm deletion

⚠️ Important: Deleting a door lock will automatically unlock it for all players.

Giving Keys to Players

In the door locks UI:

  1. Click on a door lock
  2. A sidebar opens showing nearby players
  3. Enter a player’s ID
  4. Click “Give key”
  5. The player receives a physical key item

Door Lock States

All door locks are stored in the database and persist across restarts:

  • Locked - Door is locked, requires key/access
  • Unlocked - Door is unlocked, anyone can open

💭 Note: All doors are automatically locked on server restart for security.

Tips & Best Practices

  1. Name your doors clearly - Use descriptive names like “Police Station Front Door” instead of “Door 1”
  2. Use keypad codes wisely - Don’t use obvious codes like “1234”
  3. Combine access methods - Use both physical keys and job access for important areas
  4. Set appropriate lockpick difficulty - High-security areas should be harder to lockpick
  5. Use fingerprint scanners for high-traffic areas - They provide quick access for authorized personnel
Last updated on