Crafting
Configuration
Configuration guide for fs-crafting
Config file
config.lua
--[[
📜 fs-crafting - Fusion Scripts
🔗 fusionscripts.xyz | 💬 discord.gg/fusionscripts
]]--
FS = {}
FS.Locale = 'en'
FS.ui = {
colors = {
primary = '#FF8563',
secondary = '#2B89EF',
background = '#111111',
blocks = '#161616',
blocks2 = '#333333',
primaryText = '#FFFFFF',
secondaryText = '#777777',
}
}
FS.imageDir = 'ox_inventory/web/images/'
FS.interactables = {
{
item = 'workbench',
prop = 'prop_tool_bench02',
label = 'Workbench',
headingOffset = -85.0,
},
{
item = 'advanced_workbench',
prop = 'xs_prop_x18_tool_draw_01x',
label = 'Advanced Workbench',
},
}
FS.Locations = {
{
name = 'Advanced Workbench',
type = 'advanced_workbench',
prop = 'xs_prop_x18_tool_draw_01x',
position = {
x = 120.4556,
y = -1593.7780,
z = 28.5917,
},
heading = 335.0,
},
{
name = 'Workbench',
type = 'workbench',
prop = 'prop_tool_bench02',
position = {
x = 121.5778,
y = -1606.3876,
z = 28.2955,
},
heading = 150.0,
},
}
FS.items = {
{
title = 'Advanced workbench',
item = 'advanced_workbench',
amount = 1,
duration = 60000,
experience = {
needed = 800,
reward = 150,
},
neededItems = {
{ item = 'metal_scrap', amount = 10, remove = true },
{ item = 'plastic', amount = 10, remove = true },
{ item = 'steel', amount = 10, remove = true },
{ item = 'aluminum', amount = 1, remove = true },
},
workBenches = {
'workbench',
}
},
}
Open source files
--[[
📜 fs-crafting - Fusion Scripts
🔗 fusionscripts.xyz | 💬 discord.gg/fusionscripts
]]--
function getLocale(key)
local localeTable = Locales[FS.Locale or 'en']
if not localeTable then return 'locale not found for ' .. key end
return localeTable[key] or 'locale not found for ' .. key
end
--[[
📜 fs-crafting - Fusion Scripts
🔗 fusionscripts.xyz | 💬 discord.gg/fusionscripts
]]--
function addTarget(entity, options)
if TARGET then --ox-target
TARGET:addLocalEntity(entity, {
label = options.label or 'error',
icon = options.icon or 'fas fa-exclamation-triangle',
name = options.name or 'error',
distance = options.distance or 2.0,
onSelect = options.onSelect or function() end,
})
elseif QBTARGET then -- qb-target
exports['qb-target']:AddTargetEntity(entity, {
options = {
{
label = options.label or 'error',
icon = options.icon or 'fas fa-exclamation-triangle',
targeticon = options.targeticon or 'fas fa-exclamation-triangle',
action = options.onSelect or function() end,
}
},
distance = options.distance or 2.0,
})
end
end
function getLocale(key)
local localeTable = Locales[FS.Locale or 'en']
if not localeTable then return 'locale not found for ' .. key end
return localeTable[key] or 'locale not found for ' .. key
end