Flows
How mechanical key cutting, OBD fob programming, and the NPC locksmith store work.
Mechanical Key Cutting
Used for non-electric vehicles. Can be triggered in two ways.
From the Key Cutting Station
Target zone or textui interaction at configured Interactions coordinates.
Opens a menu listing all vehicle keys currently in the locksmith's inventory.
Requirements:
- Locksmith job, on duty
- At least one
vehiclekeyitem in inventory BlankKeyitem in inventory
From the Key Cutting Tool Item
Using the KeyCuttingTool item opens a combined menu of:
- Keys in the locksmith's inventory (non-keyless only)
- Any non-electric vehicles within
KeyCuttingDistancemetres
This allows duplication without needing the owner's physical key, as long as their vehicle is present.
Requirements:
- Locksmith job, on duty
BlankKeyandKeyCuttingToolin inventory
If a vehicle is both in the locksmith's inventory and physically nearby, it only appears once in the menu ā sourced from the inventory entry.
OBD Key Fob Programming
Used exclusively for electric vehicles. Triggered by using the OBD scanner item.
The locksmith connects the scanner under the dash, reads the vehicle's key programming, and writes it to a blank key fob.
Requirements:
- Locksmith job, on duty
- Seated in the driver's seat of an electric vehicle
BlankKeyandOBDscanner in inventory
A timed animation plays for OBDConnectDuration milliseconds while the scanner reads
the key data.
Leaving the driver's seat during this window cancels the process immediately.
NPC Locksmith
When the number of on-duty locksmiths is at or below Config.Locksmith.OfflineStore.MininumDuty,
NPC peds spawn at each configured location in OfflineStore.Locations.
Players can purchase spare keys directly from the NPC without a locksmith player present.
Pricing:
- Standard mechanical key ā
OfflineStore.Prices.Mechanical - Wireless key fob (electric vehicles) ā
OfflineStore.Prices.Wireless
The NPC menu lists all vehicles owned by the interacting player. The player can choose whether to invalidate their existing key when purchasing a spare.
NPC peds are automatically removed when a locksmith comes on duty, and re-spawned when the last locksmith goes off duty or disconnects. This is handled in real time via a GlobalState handler ā no restart required.
Key Invalidation
Every duplication flow asks whether to invalidate the existing key. This is relevant when:
- A vehicle was stolen and the owner wants their key to stop working
- A locksmith is cutting a key for a customer who lost theirs
When invalidated:
- A new
keyIdis generated and written to the vehicle data - If the vehicle is currently spawned, statebags are updated immediately so the old key stops working in the active session
- The owner's existing
vehiclekeyitem becomes invalid as its storedidno longer matches the vehicle's currentkeyId
When not invalidated:
- The duplicate is cut with the same
keyIdas the existing key - Both keys work simultaneously
Minigame
All duplication flows use the same minigame sequence:
exports.minigames:Play('locksmith', { difficulty = 3 })ā the skill checklib.progressBarā a timed progress bar (5ā10 seconds, randomly) representing the physical cutting or programming work
Cancelling the progress bar or failing the minigame aborts the flow with no item consumption ā except for the OBD flow, where the animation has already played.