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:
-
Open the door locks UI (use a command or keybind configured by your server)
-
Click “Create new door lock”
-
Click “Pick door in world” - the UI will close
-
For Single Door:
- Aim at the door and left-click to select it
- The door will turn green when selected
- Right-click to confirm
-
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
-
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
-
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.
- Select “Keypad” as access type
- Set a keypad code (numeric)
- Click “Pick keypad location”
- Aim at a wall/surface near the door and left-click
- 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.
- Select “Fingerprint” as access type
- Click “Pick fingerprint location”
- Aim at a wall/surface near the door and left-click
- 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:
- In the door lock creator/editor, scroll to “Access by job”
- Click “Add job”
- Enter the job name (e.g., “police”)
- Choose grade requirements:
- All grades - Any player with this job
- Specific grades - Only players with certain grades
- 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 secondsManaging Door Locks
Editing Door Locks
- Open the door locks UI
- Find the door in the list
- Click “Edit”
- Make your changes
- Click “Save”
Deleting Door Locks
- Open the door locks UI
- Find the door in the list
- Click “Remove door lock”
- Confirm deletion
⚠️ Important: Deleting a door lock will automatically unlock it for all players.
Giving Keys to Players
In the door locks UI:
- Click on a door lock
- A sidebar opens showing nearby players
- Enter a player’s ID
- Click “Give key”
- 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
- Name your doors clearly - Use descriptive names like “Police Station Front Door” instead of “Door 1”
- Use keypad codes wisely - Don’t use obvious codes like “1234”
- Combine access methods - Use both physical keys and job access for important areas
- Set appropriate lockpick difficulty - High-security areas should be harder to lockpick
- Use fingerprint scanners for high-traffic areas - They provide quick access for authorized personnel