This script automatically locks and unlocks doors at specific in-game times and sends notifications when the doors are unlocked. The script is easily configurable via a config.lua
file.
This script relies on the following resources:
Ensure these resources are installed and properly configured in your server.
-
Download the Script
Clone or download this repository and place it in your
resources
folder. -
Add to Server Configuration
Add the script to your
server.cfg
:ensure tobi_SCT
-
Configure Door Lock IDs
Create doors in
ox_doorlock
and get their IDs. Update theconfig.lua
file with these IDs and your desired settings.
-
Create Doors in
ox_doorlock
Follow the ox_doorlock documentation to create and configure your doors. Note the IDs assigned to these doors.
-
Update Configuration
Add the door IDs to the
Config.DoorIDs
table inconfig.lua
. -
Run the Script
Ensure the script is started with your server. It will automatically handle door locking and unlocking based on the configured times and send notifications.
- The server script listens for in-game time updates and locks/unlocks doors based on the configured hours.
- The client script continuously checks the in-game time and triggers server events to update the door states.
- A notification is sent to all players at a specified time to inform them when the doors are unlocked.
Here is an example of how the door locking and notification work:
- At 22:00 in-game time, all doors listed in
Config.DoorIDs
will be locked. - At 06:00 in-game time, all doors listed in
Config.DoorIDs
will be unlocked, and a notification will be sent to all players via npwd phone.
For support and issues, please create an issue on the GitHub repository.
By following these instructions, you can easily set up and configure the Business Door Lock Script for your server.