Creating a Job

A job can be created either in Config.lua under the Config.Jobs = {} table or by creating another file in the shared folder named NewJob.lua (following ExampleJob.lua)

ExampleJob.lua
ExampleStep1 = {
  Restricted = { -- Job restrictions
    WhileListedJobs = nil,
    BlackListedJobs = { 'example1', 'example2' },
  },
  RequireJob = nil, -- Table, { job = nil, job_grade = nil, job2 = nil, job2_grade = nil }
  Blip = { -- Blip settings
    Enable = true,
    BlipForEveryLocation = false,
    Sprite = 473,
    Color = 21,
    Scale = 0.5,
    Display = 4,
    Label = 'Example Job',
    Locations = {
      vector3(-595.34, 2085.62, 130.38),
    },
  },
  Stress = { -- Default max stress is 1000000
    Enabled = true,
    Base = 5000,
    Random = true,
    Min = 3500,
    Max = 9000,
  },
  Locations = {
    vector3(-592.01, 2079.21, 130.39),
    vector3(-593.81, 2075.24, 130.42),
  },
  Model = nil -- Or a table.
  -- {
  --   Hash = 452618762,
  --   Rotation = vector3(0.0, 0.0, 0.0),
  --   PlaceOnGround = true,
  --   Freeze = true,
  -- },
  Interaction = { -- Integration with KmF_Interactions if Config.UseInteraction is true
    Distance = 15.0,
    Label = 'Scava',
    Offset = {
      label = 0.5,
      target = 0.8,
    },
    Icon = 'fa-solid fa-person-digging',
    Key = 'E',
    Duration = 500,
  },
  Animation = { 
    Scenario = false,
    Dict = "melee@large_wpn@streamed_core",
    Name = 'ground_attack_on_spot',
    Flag = 17,
    Prop = 'prop_tool_pickaxe',
    Bone = 57005,
    DisabledControls = {
      Mouse = false,
      Player = true,
      Vehicle = true
    },
  },
  Time = { -- Time to work
    Base = 1250,
    Random = true,
    Min = 4000,
    Max = 6000,
  },
  Rules = { -- Rules to work
    MinVehicleDistance = 6.0,
    MaxPlayerDistance = 3.5,
    AllowWorkInVehicle = false,
  },
  RequiredItems = { -- Required items to work
    ['pickaxe'] = {
      Remove = false,
      Amount = 1,
      Consume = 1,
      ConsumeRandom = true,
      ConsumeMin = 0.01,
      ConsumeMax = 0.3,
      Priority = 1,
    },
  },
  RequireAllItems = false, -- Require all items to work. If you have > 1 item in RequiredItems, it will require all of them.
  Drop = { -- Items to drop
    Items = {
      ['stone'] = {
        Name = 'stone',
        Base = 1,
        Random = false,
        Min = 1,
        Max = 3,
        Rarity = 84, -- %
      },
      ['gold_fragment'] = {
        Name = 'gold_fragment',
        Base = 1,
        Random = false,
        Min = 1,
        Max = 3,
        Rarity = 15, -- %
      },
      ['gold_ring'] = {
        Name = 'gold_ring',
        Base = 1,
        Random = false,
        Min = 1,
        Max = 3,
        Rarity = 1, -- %
      },
    }, 
    Amount = { -- LOOP AMOUNT (if you have more than 1 item in Items)
      Base = 1,
      Random = false,
      Min = 4,
      Max = 8,
    }
  },
  ProgressBar = { -- Progress bar settings (RProgrss)
    Enable = true,
    Settings = nil, -- or {} with custom settings
  },
  SkillCheck = { -- ox skillcheck
    Enable = false,
    Steps = 3,
    Random = true,
    Min = 1,
    Max = 3,
    Difficulty = {areaSize = 60, speedMultiplier = 1.2},
  },
  AutoWork = true, -- Work automatically if the inventory has capacity and not get cancelled
  CustomEvent = nil, -- nil or event name to trigger client side. This will override the default event.
  CustomFunction = nil, -- nil or function to trigger client side. This will override the default function.
  Messages = { -- Messages to show 
    ['NoOneRequiredItems'] = 'You have no item to start work'
  }
},

Parameters

Restricted

  • WhileListedJobs: A list of jobs that are allowed to perform this task. Set to nil if not used.

  • BlackListedJobs: A list of jobs that are not allowed to perform this task. Example: {'example1', 'example2'}.

RequireJob

  • job: The required job to perform this task.

  • job_grade: The required job grade.

  • job2: An alternative required job. (Has to be added to ESX)

  • job2_grade: The required grade for the alternative job. (Has to be added to ESX)

Blip

  • Enable: Boolean to enable or disable blip.

  • BlipForEveryLocation: Boolean to enable blip for every location.

  • Sprite: The sprite ID for the blip.

  • Color: The color ID for the blip.

  • Scale: The scale of the blip.

  • Display: The display type of the blip.

  • Label: The label for the blip.

  • Locations: A list of vector3 coordinates for blip locations.

Stress

  • Enabled: Boolean to enable or disable stress.

  • Base: The base stress value.

  • Random: Boolean to enable random stress.

  • Min: The minimum stress value.

  • Max: The maximum stress value.

Locations

A list of vector3 coordinates where the job can be performed.

Model

  • Hash: The hash value for the model.

  • Rotation: The rotation vector for the model.

  • PlaceOnGround: Boolean to place the model on the ground.

  • Freeze: Boolean to freeze the model.

Interaction

  • Distance: The interaction distance.

  • Label: The interaction label.

  • Offset: The offset for label and target.

    • label: Offset for the label.

    • target: Offset for the target.

  • Icon: The icon for the interaction.

  • Key: The key to trigger the interaction.

  • Duration: The duration of the interaction.

Animation

  • Scenario: Boolean to enable or disable scenario.

  • Dict: The animation dictionary.

  • Name: The animation name.

  • Flag: The animation flag.

  • Prop: The prop used in the animation.

  • Bone: The bone ID for the prop.

  • DisabledControls: Controls to disable during the animation.

    • Mouse: Boolean to disable mouse controls.

    • Player: Boolean to disable player controls.

    • Vehicle: Boolean to disable vehicle controls.

Time

  • Base: The base time to work.

  • Random: Boolean to enable random time.

  • Min: The minimum time to work.

  • Max: The maximum time to work.

Rules

  • MinVehicleDistance: The minimum distance from a vehicle.

  • MaxPlayerDistance: The maximum distance from a player.

  • AllowWorkInVehicle: Boolean to allow work in a vehicle.

RequiredItems

A table of items required to perform the job.

  • Remove: Boolean to remove the item after use.

  • Amount: The amount of the item required.

  • Consume: The amount of the item consumed.

  • ConsumeRandom: Boolean to enable random consumption.

  • ConsumeMin: The minimum amount of the item consumed.

  • ConsumeMax: The maximum amount of the item consumed.

  • Priority: The priority of the item.

RequireAllItems

  • RequireAllItems: Boolean to require all items listed in RequiredItems.

Drop

A table of items to drop after the job is completed.

  • Items: A table of items with their drop settings.

    • Name: The name of the item.

    • Base: The base amount of the item.

    • Random: Boolean to enable random drop amount.

    • Min: The minimum amount of the item.

    • Max: The maximum amount of the item.

    • Rarity: The rarity percentage of the item.

  • Amount: The loop amount settings for dropping items.

    • Base: The base loop amount.

    • Random: Boolean to enable random loop amount.

    • Min: The minimum loop amount.

    • Max: The maximum loop amount.

ProgressBar

  • Enable: Boolean to enable or disable the progress bar.

  • Settings: Custom settings for the progress bar.

SkillCheck

  • Enable: Boolean to enable or disable skill check.

  • Steps: The number of steps in the skill check.

  • Random: Boolean to enable random skill check.

  • Min: The minimum skill check value.

  • Max: The maximum skill check value.

  • Difficulty: The difficulty settings for the skill check.

    • areaSize: The size of the skill check area.

    • speedMultiplier: The speed multiplier for the skill check.

AutoWork

  • AutoWork: Boolean to enable or disable automatic work.

CustomEvent

  • CustomEvent: The custom event name to trigger client-side.

CustomFunction

  • CustomFunction: The custom function to trigger client-side.

Messages

  • NoOneRequiredItems: The message to show when no required items are found. (Nota that this is a default message that will be triggered by the default work event)

Last updated