Skip to Content
TC KeysJob Keys

Job Key System

Job keys are universal master keys that grant access to multiple doors based on a player’s job and grade.

How It Works

Unlike regular door keys that are specific to one door, job keys:

  • Grant access to all doors configured for that job
  • Are universal for a job role (not tied to specific doors)
  • Require grade validation per door
  • Are automatically validated and removed if invalid

Job Key Item

  • Item: job_door_key (configurable)
  • Metadata: {job = "police", description = "Master key for police"}
  • Stack: No (each key is unique)

💭 Note: Job keys do NOT store grade information. Grade validation happens per-door based on the player’s current grade.

Getting Job Keys

Set up NPCs that dispense job keys to authorized personnel:

  1. Create a door lock (any door)
  2. Configure job access for that door
  3. In the door lock editor, scroll to “NPC Location”
  4. Click “Pick NPC location”
  5. Aim at the desired location and left-click
  6. An NPC will spawn at that location

How players get keys:

  1. Walk up to the NPC
  2. Press the interaction key
  3. If authorized (correct job/grade), receive a job key
  4. If already have a key, receive a message

NPC Configuration:

  • Each NPC is linked to a door’s job access list
  • NPCs validate job and grade before dispensing
  • Only one key per job per player
  • Keys are universal but validated per-door

✅ Tip: NPC dispensers provide the most immersive roleplay experience.

Using Job Keys

As a Player

  1. Walk up to a door configured for your job
  2. Use the job key item from your inventory
  3. If your current job/grade matches the door’s requirements:
    • The door toggles (lock/unlock)
    • A key animation plays
  4. If your grade is insufficient:
    • You see an error message
    • The door remains locked

⚠️ Important: Grade validation happens at the time of use, not when the key is given. The same key can open different doors based on your current grade.

Grade Validation

Job keys use a smart validation system:

Universal Keys with Per-Door Grades

  1. Key is universal - One key for all police doors
  2. Validation is per-door - Each door can require different grades
  3. Current grade matters - Your grade at time of use is checked

Example:

-- Door 1: Police Station Front Door -- Job Access: police, grades [0, 1, 2, 3, 4] -- Door 2: Police Armory -- Job Access: police, grades [3, 4] -- Officer Smith (police, grade 2): -- ✅ Can open Front Door (grades 0-4 allowed) -- ❌ Cannot open Armory (grades 3-4 required) -- Sergeant Jones (police, grade 3): -- ✅ Can open Front Door -- ✅ Can open Armory

Automatic Validation & Cleanup

The system automatically validates job keys:

On Key Receipt:

  • Checks if player has the correct job
  • Removes key if job doesn’t match

On Key Use:

  • Checks current job matches key’s job
  • Checks current grade meets door’s requirements
  • Removes key if job changed

On Job Change:

  • Invalid keys are automatically removed
  • Player is notified

💭 Note: This prevents exploits where players keep keys after job changes.

Configuring Job Access on Doors

In the door lock creator/editor:

Step 1: Add Job Access

  1. Scroll to “Access by job”
  2. Click “Add job”
  3. Enter the job name (e.g., “police”)
  4. Choose grade requirements

Step 2: Grade Options

Option A: All Grades

  • Toggle “All grades”
  • Any player with this job can access
  • Recommended for: Common areas, break rooms

Option B: Specific Grades

  • Untoggle “All grades”
  • Enter grade numbers (e.g., 3, 4)
  • Only players with these grades can access
  • Recommended for: Armories, evidence rooms, chief’s office

Step 3: Multiple Jobs

Add multiple jobs if needed:

  • Police and sheriff can both access
  • Different grade requirements per job
  • Each job needs its own job key

✅ Tip: Use job access with fingerprint scanners for quick, secure access to high-traffic areas.

Setting Up NPC Key Dispensers

Best Practices for NPC Placement

  1. Place in secure areas - Captain’s office, HR department
  2. Near the job’s main area - Inside police station, not outside
  3. Clear line of sight - Players should see the NPC
  4. Logical location - Where keys would realistically be given

Configuring NPC Behavior

NPC Model (Optional):

-- In door lock editor npcModel = "s_m_y_cop_01" -- or any valid ped model

If no model specified, a default model is used.

NPC Interaction:

  • Interaction radius: Automatic (based on target system)
  • Interaction key: Configured by tc_lib target system
  • One key per player per job
  • Validates job/grade before dispensing

Losing Job Keys

You may lose your job key when:

  • Job changes - Keys are removed when you change jobs
  • Fired/demoted - Keys may be revoked if you lose your position
  • Disciplinary action - Keys can be taken for disciplinary reasons
  • Off duty - Some servers remove keys when you go off duty (optional)

Automatic Removal

Job keys are automatically removed when:

  • Player’s job changes
  • Player receives a job key for the wrong job (validation fails)

Validation System

The job key system includes smart validation:

  • On receiving key - System checks if you have the correct job
  • On using key - System validates your current job and grade match the door’s requirements
  • On job change - Invalid keys are automatically removed from your inventory

This prevents exploits where players keep keys after changing jobs.

Tips & Best Practices

  1. Use NPC dispensers - More immersive than automatic key giving
  2. Place NPCs in secure areas - Prevent unauthorized access to dispensers
  3. Set appropriate grade requirements - Not all doors need high-grade access
  4. Combine with fingerprint scanners - Job keys + fingerprint = quick secure access
  5. One NPC per job area - Police get keys from police NPC, ambulance from ambulance NPC
  6. Don’t remove keys on off-duty - Unless your server rules require it
  7. Use per-door grade requirements - Different doors can require different ranks
Last updated on