An easy feature packed doorlock system for VORP/RedM.
No “hash list” involved, as long as the door works within game, this resource will get that information for you upon creating the door.
Features
- Easily create, edit and delete doors
- Supports single and double doors
- Updates all clients without needing to relog or restart resources.
- Persistent via database
- Character permissions, and/or job permissions
- Show/Hide UIPrompts and/or sprite
- Enable/Disable lockpicking per door
- Enable/Disable whether or not door is automatically locked on startup
- Server-Side & Client-Side API that can be used in other resources
- Locale (English is already included, feel free to translate and do a PR)
- 0.0 Resmon idle and ~0.04 when UIPromts are displayed
Commands
/createdoor - Create a new door
- Create single & double doors
- Control what jobs can access the lock
- Control what characters via their character Identifier can access the lock
- Name your locks with custom names (which can be be used to grab locks via api)
- Enable/Disable the UIPrompt for the lock (You can use the /togglelock command to still toggle the door lock)
- Enable/Disable whether or not the door is locked automatically on startup
- Enable/Disable whether or not the lock can be lockpicked (with item configured)
/editdoor - Edit the closest door
- Change the door’s name
- Edit job permissions
- Edit character permissions
- Enable/Disable the UIPrompt for the lock (You can use the /togglelock command to still toggle the door lock)
- Enable/Disable whether or not the door is locked automatically on startup
- Enable/Disable whether or not the lock can be lockpicked (with item configured)
- Delete the door
/togglelock - Toggle the closest doorlock (Also works when UIPrompts are hidden)
Video Examples
Create Double Door
Create Single Door
Edit Door
UIPrompt Interactions
Lockpick Door
ToogleLock Command
API
Client Side
CreateDoor | Opens the “create door” menu and returns the door ID when completed or nil when canceled
exports.gs_doorlocks:CreateDoor()
GetDoorId | Returns the door id or nil if canceled (works great for existing doors that have already been created)
exports.gs_doorlocks:GetDoorId()
ClosestDoor | Returns the closest door or nil if none
exports.gs_doorlocks:ClosestDoor()
Server Side
GetAPI | Returns the doorlock class containing functions to easily update door locks
local DoorLocks = exports.gs_doorlocks:GetAPI()
There’s various class functions to update locks
local DoorLocks = exports.gs_doorlocks:GetAPI()
local Door = DoorLocks:Door(id:int)
Door.fn.SetLock(true|false) -- Lock/Unlock Door
Door.fn.SetName(name:str) -- Set the locks name
Door.fn.SetLockOnStart(true|false) -- Enable/Disable automatic lock on startup
Door.fn.SetCanLockpick(true|false) -- Enable/Disable lockpick functionality
Door.fn.ShowUIPrompt(true|false) -- Enable/Disable UIPrompt when player is within range
-- Job Access / Permissions
Door.fn.SetJobAccess(access:table) -- Replaces the job access table. Eg. {'name1', 'name2', ...}
Door.fn.AddJob(name:str) -- Add a job name to existing table
Door.fn.RemoveJob(name:str) -- Remove a job name from existing table
-- Character Access / Permissions
Door.fn.SetCharAccess(access:table) -- Replaces the character access table. Eg. {1, 4, 2, ...}
Door.fn.AddChar(characterIdenntifer:int) -- Add a character to existing table
Door.fn.RemoveChar(characterIdenntifer:int) -- Remove a character from existing table
All updates and changes are updated too all clients in real time (no need to relog)
Dependencies
While this resource was built around VORP it could be modified for any framework.
Todo
Add time based locks (Lock/Unlock doors based on time of day)
Auto lock (maybe)
I’m always open to cool ideas that will benefit everyone. I’m not perfect, if there’s a bug please report it or open a PR.
Download
Other Resources
Code is accessible | Yes |
Subscription-based | No |
Lines (approximately) | ~2000 |
Requirements | VORP Core, VORP Inventory, VORP Menu, VORP Inputs |
Support | Yes |