Configuration

5 min readUpdated 2 weeks ago

Overview

  • shared/config.lua: language, theme, interaction, stash and dispatch defaults
  • shared/lists.lua: prop models and animations offered in the editor
  • shared/config_minigames.lua: minigame definitions
  • server/config_server.lua: skills, battlepass and Discord webhooks

Zones, categories, loot tables, world props, tools, cooldowns and the rotation settings live in the database and are edited from the admin panel.

General

shared/config.lua
1Config.Debug = false
2Config.Language = 'en'
3Config.Theme = 'default'
4Config.MainColor = nil
5Config.Command = 'mlloot'
  • Debug: prints extra console output
  • Language: language file loaded from the locales/ folder
  • Theme: admin panel theme. 'default', 'wasteland', 'cyberpunk', 'noir' or 'fantasy'
  • MainColor: hex accent color. nil keeps the theme color
  • Command: opens the admin panel. Admin permission required

UI Theme

shared/config.lua
1Config.UITheme = {
2    preset = nil,
3    colors = {
4        primary = nil,
5        accent = nil,
6        background = nil,
7        surface = nil,
8        text = nil,
9    },
10}
  • preset: theme preset for this resource. nil follows the shared theme set in ml_bridge
  • colors: CSS hex values for single colors. Any nil value follows the shared theme

Admin Panel

shared/config.lua
1Config.Admin.MinimizeKey = 'F9'
  • MinimizeKey: hides and restores the admin panel, so you can look at the world while editing. F1 to F12, or a single letter or digit

Interaction

shared/config.lua
1Config.Settings = {
2    Interaction = nil,
3    InteractionDistance = 2.0,
4    MaxLootDistance = 5.0,
5    MaxSpawnAttempts = 50,
6}
  • Interaction: nil uses the target resource when one is running and a press-E prompt otherwise. 'target' or 'textui' forces one of the two
  • InteractionDistance: range of the target option or prompt, in meters
  • MaxLootDistance: maximum distance the server accepts for a loot claim, in meters
  • MaxSpawnAttempts: placement retries for each random prop in a zone

Lootbox Stash

A prop set as a lootbox opens a stash instead of giving the items straight away.

shared/config.lua
1Config.Stash = {
2    Prefix = 'ml_loot',
3    DefaultLabel = 'Loot',
4    Slots = 20,
5    MaxWeight = 50000,
6}
7
8Config.AbandonedStashSeconds = 600
  • Prefix: prefix of the stash IDs
  • DefaultLabel: stash title when the prop has no label of its own
  • Slots: stash slots
  • MaxWeight: maximum weight in grams
  • AbandonedStashSeconds: an opened stash left idle this long is cleared and its prop counts as looted. 0 turns the check off

With ML Inventory, grid size, stash theme and the loot reveal delay are set per prop in the editor.

Dispatch

Zones and categories can override every default below from the admin panel.

shared/config.lua
1Config.Dispatch = {
2    Enabled = true,
3    DefaultCooldown = 180,
4    DefaultChance = 50,
5    Jobs = { 'police', 'sheriff' },
6    BlipSprite = 161,
7    BlipColor = 1,
8    BlipFlash = true,
9    DefaultMessage = 'Suspicious Activity',
10}
  • Enabled: turns police alerts on or off for every zone
  • DefaultCooldown: seconds between two alerts from the same zone
  • DefaultChance: chance from 0 to 100 that a loot sends an alert
  • Jobs: jobs that receive the alert
  • BlipSprite, BlipColor, BlipFlash: map blip of the alert
  • DefaultMessage: alert text

Rotation and Startup Delay

Both are set in the Settings tab of the admin panel.

Each category keeps between a minimum and a maximum number of zones active and reshuffles them after a random interval. A category set to Always Active keeps every zone on and only refreshes the loot.

After a server start, zones stay closed for a random time between a minimum and a maximum, so loot opens once players have joined. Players who try to loot early see the time left. Set both values to 0 to turn the delay off.

Lists

shared/lists.lua
1Config.PropModelList = {
2    'prop_cash_crate_01',
3    'prop_tool_box_02',
4}
5
6Config.AnimationsList = {
7    { label = _L('anim_search_bin'), anim = 'base', dict = 'amb@prop_human_bum_bin@base' },
8}
  • PropModelList: models offered in the prop picker
  • AnimationsList: search animations offered per prop. label, anim (clip) and dict (dictionary)

Minigames

Minigames are picked per prop in the loot editor. The four ox_lib skill checks are always listed. Lockpick and thermite appear with bd-minigames, the scrambler with ps-ui.

shared/config_minigames.lua
1Config.AvailableMiniGames["my_custom_game"] = {
2    label = "My Custom Game",
3    Start = function(params)
4        return exports['my-minigames']:StartGame('hard')
5    end
6}

Start returns true on success and false on failure.

Skills

server/config_server.lua
1Config.Skills = {
2    Enabled = true,
3    Resource = 'ml_skills',
4    MaxXpPerLoot = 500,
5}
  • Enabled: false turns off XP rewards and skill requirements
  • Resource: name of the skills resource
  • MaxXpPerLoot: highest XP the server grants for one loot, whatever the prop says

XP amounts and required skills are set per prop in the loot editor.

Battlepass

server/config_server.lua
1Config.Battlepass = { Enabled = true }
  • Enabled: with ml_battlepass running, looting advances battlepass objectives. false turns it off. Without ml_battlepass this setting does nothing

Discord Webhooks

server/config_server.lua
1Config.DiscordWebhook = {
2    ZoneEdit = 'INSERT_WEBHOOK_LINK_HERE',
3    ZoneDelete = 'INSERT_WEBHOOK_LINK_HERE',
4    CategoryEdit = 'INSERT_WEBHOOK_LINK_HERE',
5    CategoryDelete = 'INSERT_WEBHOOK_LINK_HERE',
6    SettingsChange = 'INSERT_WEBHOOK_LINK_HERE',
7    LootCollect = 'INSERT_WEBHOOK_LINK_HERE',
8    ExploitDetected = 'INSERT_WEBHOOK_LINK_HERE',
9    PropEdit = 'INSERT_WEBHOOK_LINK_HERE',
10    LootTypeEdit = 'INSERT_WEBHOOK_LINK_HERE',
11    PropCategoryEdit = 'INSERT_WEBHOOK_LINK_HERE',
12}
  • ZoneEdit, ZoneDelete: a zone is created, edited or deleted
  • CategoryEdit, CategoryDelete: a category is edited or deleted
  • SettingsChange: global settings change
  • LootCollect: a player loots a prop
  • ExploitDetected: a claim fails a server check (distance, skipped minigame, malformed data)
  • PropEdit: a world prop is created, edited or deleted
  • LootTypeEdit: a loot type changes
  • PropCategoryEdit: a world prop category changes

Set any webhook to false to disable that log entirely.