server side
Registers a new crafting location with recipes and configuration.
Parameters:
data(table): Crafting configuration object containing:loc(table): Array of location objects with coordinates and checksrecipes(table): Recipe definitions with items, amounts, and requirementschecks(table, optional): Access restrictions (job, gang, items, citizenid)targetData(table, optional): Target system configuration
Returns:
None
Export:
exports['ps-lib']:registerCrafter(data)
Configuration Structure
Basic Crafting Location
local craftingData = {
loc = {
{
loc = vector3(-819.71, -859.37, 20.71),
checks = {} -- Location-specific restrictions
}
},
recipes = {
lockpick = {
amount = 1,
time = 5000,
anim = 'uncuff',
recipe = {
steel = 2,
iron = 1
}
}
},
checks = { -- Global restrictions for this crafter
job = {'police', 'mechanic'},
},
targetData = {
size = {
height = 1.0,
width = 1.0,
length = 1.0,
rotation = 180.0
},
label = 'Open Crafting',
icon = 'fa-solid fa-hammer'
}
}
exports['ps-lib']:registerCrafter(craftingData)Recipe Configuration
Recipe Properties
KEY VALUE (item name)amount(number, optional): Number of items to give. Default: 1time(number, optional): Crafting time in milliseconds. Default: 5000anim(string, optional): Animation/emote to play. Default: 'uncuff'recipe(table, optional): Required items and amounts. Default: {} (free craft)minigame(table, optional): Minigame configuration
Example\
Minigame Integration
Job Restrictions
or
Gang Restrictions
or
Item Requirements
or
Citizen ID Restrictions
or
Multiple Restrictions
Usage Examples
Basic Workshop
Last updated