Config
Example Recipe
['example_recipe'] = {
count = 1, -- how many items to get for the required materials
requireBlueprint = false, -- true = will show without blueprint / false = need blueprint to see
xpReward = 200, -- how much xp to give
levelRequired = 1, -- what level is needed to craft the recipe
duration = 10000, -- crafting duration (it will be duration * quantity)
maxCraftAmount = 2, -- how many items you can craft at maximum (remove this line and you can craft as many as you have materials for)
title = 'Example item', -- used only if you dont have ox_inventory or qs-inventory (otherwise its automatic)
requiredJob = 'police', -- this can be used to restrict specific recipe behind job
-- this one works only for recipes/books.lua
location = {
vec3(0.0, 0.0, 0.0), -- you can craft this recipe only at these coordinates
radius = 10.0
},
-- this one works only for recipes/books.lua
requirements = {-- table containing all required materials being item = amount
['example_1'] = 1,
}
},General Config
sm_crafting/config.lua
Config = {}
Config.Debug = true
-- EDIT LOCALE IN bridge/locales.lua
-- items that wont be removed upon crafting
Config.PermanentItems = {
['shaker'] = {
durability = {1,2} -- set to nil to disable otherwise it will reduce this amount of durability per crafting
},
['wrench'] = {
durability = {1,2} -- set to nil to disable otherwise it will reduce this amount of durability per crafting
},
}
Config.Inventory = 'ox_inventory' -- ox_inventory / qs-inventory / qb-inventory / esx
Config.ImagePath = 'nui://ox_inventory/web/images/' -- location of your images
Config.Target = 'ox_target' -- ox_target / qb-target
-- these are usable items which will add it to your crafting book as permanent recipe
Config.Blueprints = {
-- item name = recipe key
['formula_pistol'] = {
key = 'WEAPON_PISTOL', -- this must be the key name for the recipe
text = 'Pistol', -- shown in notify when player adds blueprint
},
['blueprint_musket'] = {
key = 'WEAPON_MUSKET', -- this must be the key name for the recipe
text = 'Musket', -- shown in notify when player adds blueprint
},
}
-- starts from level 1 so first value must be [2]
-- Level system configuration
-- Key = Level number, Value = XP required to reach that level
Config.Levels = {
[2] = 500,
[3] = 1000,
[4] = 2500,
[5] = 5000,
[6] = 10000,
}
Crafting Points
sm_crafting/recipes/points.lua
Config.CraftingPoints = {
['general_table'] = {
levels = true,
job = nil,
grade = 0,
coords = vector4(2261.7319, 4981.0361, 41.3960, 48.778), -- set this to nil if you want to use allprops
prop = 'gr_prop_gr_bench_02a',
allprops = false, -- true == all props on the map
targetLabel = 'Open example recipe',
targetIcon = 'fa-solid fa-fire',
categories = {
['rust'] = {
label = 'Rust',
animation = {
scenario = 'WORLD_HUMAN_WELDING',
duration = 20000,
},
recipes = {
['cleanedcoin'] = {
count = 1,
global = false,
requirements = {
['rustcoin1'] = 1,
['rustremovalliquid'] = 1,
}
},
}
}
},Crafting Books
sm_crafting/recipes/books.lua
Config.Books = {
-- ITEM NAME must be added as item in ox_inventory or other inventory resource (qs-inventory)
['craftingbook'] = {
levels = true, -- will enable level system for this specific category (UI)
categories = {
['weapons'] = {
label = 'Weapons',
animation = {
dict = 'mini@repair',
anim = 'fixing_a_ped',
},
recipes = {
['WEAPON_PISTOL'] = {
count = 1, -- how many items to get for the required materials
requireBlueprint = true, -- true = need blueprint to see / false = will show without blueprint
xpReward = 200, -- how much xp to give
levelRequired = 1, -- what level is needed to craft this
duration = 10000, -- crafting duration (it will be duration * quantity)
requirements = {
['metal'] = 30, -- quantity is amount needed for one piece
['spring'] = 1,
['pistolbarrel'] = 1,
['pistolbody'] = 1,
['plastic'] = 5,
}
},
['WEAPON_VINTAGEPISTOL'] = {
count = 1,
requireBlueprint = false, -- true = need blueprint to see / false = will show without blueprint
xpReward = 50, -- how much xp to give
levelRequired = 1, -- what level is needed to craft this
duration = 100, -- crafting duration
requiredJob = 'police',
requirements = {
['metal'] = 1, -- quantity is amount needed for one piece
}
},
},
},
['ammo'] = {
label = 'Ammo',
animation = {
dict = 'mini@repair',
anim = 'fixing_a_ped',
},
recipes = {
['ammo-9'] = {
count = 1,
requireBlueprint = false, -- if its set to false it will be shown always on crafting book
xpReward = 50, -- how much xp to give
levelRequired = 1, -- what level is needed to craft this
duration = 100, -- crafting duration
location = {
vec3(2347.2190, 3138.7129, 48.2088), -- you can craft this recipe only at these coordinates
radius = 10.0
},
requirements = {
['metal'] = 1, -- quantity is amount needed for one piece
}
},
},
},
}
},
}Usable Items
sm_crafting/recipes/usable_items.lua
Config.UsableItems = {
['bbq'] = { -- ITEM NAME
prop = 'prop_bbq_5', -- PROP TO BE USED
targetLabel = 'Open BBQ',
categories = {
['suolaiset'] = {
label = 'Food',
animation = {
male = {
scenario = "PROP_HUMAN_BBQ",
duration = 15000,
},
female = {
dict = 'amb@prop_human_bbq@male@idle_a',
anim = 'idle_b',
duration = 10000,
AnimationOptions = {
Prop = "prop_fish_slice_01",
PropBone = 28422,
PropPlacement = {
0.0,
0.0,
0.0,
0.0,
0.0,
0.0
},
EmoteLoop = true,
EmoteMoving = true
}
}
},
recipes = {
['pizza_pepperoni'] = {
count = 6,
requirements = {
pepperoni = 6, egg = 1, vehnajauho = 1, egg = 1, tomatosauce = 1
}
},
['hamburger'] = {
count = 4,
requirements = {
flour = 1, deer_meat = 1, onion = 1, cheese = 1
}
},
['carrotcake'] = {
count = 1,
requirements = {
carrot = 2, flour = 1, egg = 1, sugar = 1
}
},
},
},
}
},
}animation = {
dict = 'anim@scripted@freemode@postertag@graffiti_spray@heeled@',
anim = 'shake_can_female',
duration = 10000,
AnimationOptions = {
Prop = "prop_bar_cockshaker",
PropBone = 28422,
PropPlacement = {
0.0,
0.0,
-0.17,
0.0,
0.0,
0.0
},
EmoteLoop = true,
EmoteMoving = true
}
},animation = {
scenario = 'WORLD_HUMAN_WELDING',
duration = 20000,
},Last updated