πŸ”‘Physical Keys

This guide explains how to set up physical keys for nolag_properties.

Requirements

  • ox_inventory - Physical keys only work with ox_inventory. If you use a different inventory system, physical keys will be automatically disabled.

Configuration

Enable physical keys in your config.lua:

PhysicalKeys = {
    Enabled = true, -- Enable physical key system
    ItemName = 'housing_key', -- The item name for physical keys
    MasterKeyItemName = 'housing_master_key', -- The item name for master keys
    BittingCodeLength = 5, -- Length of the random bitting code portion
    KeyTypes = {
        MainEntrance = true, -- Keys for main property entrance (Shell/IPL)
        InteractablePoints = true, -- Keys for individual interactable points
        Doors = true, -- Keys for individual MLO doors
        MasterKey = true, -- Master key that unlocks everything
    },
    AllowRekey = true, -- Allow changing lock cylinders
    RekeyPrice = 500, -- Cost to re-key a lock
},

Adding Items to ox_inventory

Add the following items to your ox_inventory/data/items.lua:

Key Types

Main Entrance Key (E)

  • Available for Shell and IPL properties

  • Unlocks the main entrance door

Interactable Point Key (P)

  • Available for all property types

  • Unlocks specific interactable points (inventory, wardrobe, etc.)

Door Key (D)

  • Available for MLO properties

  • Unlocks specific doors within the property

Master Key (M)

  • Available for all property types

  • Unlocks all doors and interactable points on the property

Bitting Code Format

Each key has a unique bitting code that identifies which lock it opens:

  • PPPPPP - Property ID (6 digits, zero-padded)

  • T - Lock Type (E=Entrance, P=Point, D=Door, M=Master)

  • LLLL - Lock ID (4 digits, zero-padded)

  • RRRRR - Random code (5 digits by default)

Example: 000001_E_0000_63323 means:

  • Property ID: 1

  • Lock Type: Entrance

  • Lock ID: 0

  • Random Code: 63323

Re-keying

When a lock is re-keyed:

  1. A new bitting code is generated

  2. All existing keys for that lock become invalid

  3. New keys must be issued with the new bitting code

This simulates changing the lock cylinder in real life.

Managing Keys

Keys can be managed through the property management menu:

  1. Open the property management menu

  2. Go to the "Physical Keys" tab

  3. Select a lock to issue keys or re-key

Exports

The following exports are available for integration:

Last updated