Script Configuration
Config Settings & Explanations
Configuration
The NKN-CraftingTable script can be customized through the Config.lua
file. This file allows you to adjust various settings to fit the script to your server's needs.
Basic Configuration
Language Settings
Set the default language for the script. The language codes should match those defined in language.lua
.
Framework Selection Define the server framework used. This script is currently tailored for ESX frameworks.
Debug Mode Enable or disable debug mode, which can be useful for troubleshooting.
Advanced Settings
Image Path Specifies the path to the image resources used in the user interface. (set your inventory img path)
Database Check Interval Sets the interval for checking the crafting database.
Render Distance for Markers Determines how far players can be from crafting tables for markers and NPCs to render.
Interaction Distance Defines how close a player needs to be to interact with the crafting tables.
Additional Script Configurations
The NKN-CraftingTable script includes additional configurations to further customize its behavior.
Allow Multiple Crafting
Config.allowMultipleCrafting This setting determines whether players are allowed to engage in multiple crafting processes at the same time, either on the same or different crafting tables.
When set to true
, players can start multiple crafting sessions simultaneously. If set to false
, they must complete or cancel a crafting process before starting another.
Config.allowOfflineProgress This configuration controls whether crafting progress continues even when the player is offline.
If true
, crafting processes will continue to progress even if the player logs off the server. Setting this to false
requires players to be online for their crafting duration to decrease.
Command Configuration
Define custom commands for server administrators:
Clear Individual Crafting Database
Clear All Crafting Databases
Admin Roles
Specify server roles that have administrative access to crafting table commands
Edit Tables
In Config.lua
, you can define the locations and settings for each crafting table on your server using the Config.Coords
table. Here's how you can set it up:
Each table is defined with a unique name and contains its own settings and crafting recipes.
Adding More Tables
To add more tables, replicate the structure within Config.Coords
and adjust the settings as needed. Ensure each table and item has a unique name.
Client and Server Notifications + Triggers
clientnotify Function
Used to display notifications to the client. It triggers the ESX notification event.```lua
serverNotify Function Used to send notifications from the server to a specific client.
debug Function Prints debug messages to the console if debug mode is enabled in the configuration. It helps in troubleshooting and development.
Config.Triggers Defines the ESX events that the script listens to. These events are crucial for the script's interaction with the ESX framework.
playerLoaded
: This event is triggered when a player successfully loads into the server. It's used to initialize player-specific data or settings.setJob
: This event is triggered when a player's job is set or updated. It can be used to refresh job-related permissions or functionalities.
These utility functions and triggers are essential for the script's operation and integration with the ESX framework. Make sure they are correctly set up and correspond to the events and functionalities of your server's version of ESX.
Last updated