Skip to content

Workbenches

You can add your workbenches in /data/workbench.lua.

Options

  • coords vector4 — Coordinates of the triggering point

  • distance number — Interactive distance

  • prop? table — Will only spawn when defined

    • model string
    • coords vector4
  • useTarget? boolean — Use ox_target instead of marker to open the workbench. The target will be on the prop if defined, or else will create a sphere zone at the coords

  • blip? table — Will only show when defined

    • sprite number — Appearance of the blip, refer to FiveM documentation for sprite ID
    • color number — Colour of the blip, refer to FiveM documentation for colour ID
    • scale number
    • name string — Label of the blip
  • job? table[] — Only the job defined here can interact with the workbench

    • [jobName] number — Define the key as the job's name and the value as the minimum grade
  • crafts? table — put the ID (the key) of the recipe that can be crafted in this workbench, the recipe must be defined in data/craft.lua

  • dismantles? table — put the ID (the key) of the recipe that can be dismantled in this workbench, the recipe must be defined in data/dismantle.lua

Examples

lua
local workbench = {
    {
        coords = vec4(210.4228, -927.1317, 30.6920, 236.9225),
        distance = 1.2,
        prop = {
            model = 'gr_prop_gr_bench_04a',
            coords = vec4(211.5069, -927.7875, 30.6920, 236.9225)
        },
        blip = {
            sprite = 544,
            color = 11,
            scale = 0.9,
            name = 'Workbench'
        },
        crafts = {'t20', 'pistol'},
        dismantles = {'cloth'}
    },
    {
        coords = vec4(309.4300, -596.9056, 43.2918, 344.7367),
        distance = 3.0,
        job = {['ambulance'] = 2},
        crafts = {'bandage'},
        dismantles = {'bandage'},
        useTarget = true
    },
}

return workbench