Configuration

8 min readUpdated Today

Overview

All settings live in shared/config.lua. This page covers every value: drop weights, the 15 standard pack definitions, drawable exclusions, bag stash sizes, timings, the internal clothing map, default drawables, and custom packs.

General

shared/config.lua
1Config.Debug = false      -- Enable debug prints in console
2Config.Language = 'en'    -- language code; see the locales/ folder
  • Config.Debug: prints internal debug lines prefixed with [ml_random_clothing] when true. Leave false in production.
  • Config.Language: selects the locale used for in-game text. The resource ships with en and it locale files. The other codes listed in the comment fall back to en if no matching locale file is present.

Drop Weights

shared/config.lua
1Config.ItemPercentages = {
2    mask = 8,          -- Face mask
3    hat = 8,           -- Head accessory
4    earrings = 8,      -- Ear accessory
5    glasses = 8,       -- Eyewear
6    chain = 8,         -- Necklace/chain
7    undershirt = 8,    -- Undershirt
8    jacket = 18,       -- Outer top (higher chance)
9    pants = 18,        -- Leg wear (higher chance)
10    bodyarmor = 3,     -- Body armor (rare)
11    bracelet = 8,      -- Wrist accessory
12    watch = 8,         -- Watch
13    bag = 3,           -- Backpack (rare)
14    shoes = 8,         -- Footwear
15    gloves = 8,        -- Hand wear
16    decals = 5,        -- Decals/badges
17}
  • Config.ItemPercentages: relative weight for each clothing type. A higher number means that type is picked more often. These are relative weights, not percentages, and they do not need to sum to 100. A single pack_jacket always gives a jacket, so the weights only matter for packs or loot tables that mix several types.

Excluded Drawables

shared/config.lua
1Config.ExcludedDrawables = {
2    female = {
3        pants = { 5, 10 },
4        jacket = { 20 },
5    },
6    male = {
7        pants = { 3, 7 },
8        jacket = { 12, 14 },
9    },
10}
  • Config.ExcludedDrawables: GTA drawable IDs the random generator skips, per gender and per clothing type, because those models are broken or glitched. Any drawable listed here is never rolled in standard random mode. Add IDs under the matching gender and type to blacklist more.

Bag Sizes

shared/config.lua
1Config.BagSizes = {
2    female = {
3        [1] = { weight = 5000,  cols = 3, rows = 2 },
4        [2] = { weight = 10000, cols = 4, rows = 3 },
5        [3] = { weight = 10000, cols = 5, rows = 3 },
6    },
7    male = {
8        [1]  = { weight = 5000,  cols = 3, rows = 2 },
9        [2]  = { weight = 10000, cols = 4, rows = 3 },
10        [50] = { weight = 15000, cols = 5, rows = 4 },
11    },
12}
  • Config.BagSizes: stash size per bag drawable, keyed by GTA drawable index, split by gender. weight is the stash capacity, cols and rows define the grid.
  • This table also acts as a whitelist for bags in random mode: when a pack_bag is opened, only drawable IDs that have an entry here can be rolled. A bag drawable with no size entry is never given.

Timings

shared/config.lua
1Config.Progress = {
2    OpenDuration = 2500, -- Duration (ms) of the progress bar when opening a clothing item
3}
  • Config.Progress.OpenDuration: length in milliseconds of the progress bar shown while opening any pack, standard or custom. Default 2500 (2.5 seconds).

Clothing Map

shared/config.lua
1Config.ClothingItems = {
2    hat        = { slot = 11, type = 'prop',      componentId = 0 },
3    undershirt = { slot = 12, type = 'component', componentId = 8 },
4    jacket     = { slot = 13, type = 'component', componentId = 11 },
5    bodyarmor  = { slot = 14, type = 'component', componentId = 9 },
6    gloves     = { slot = 15, type = 'component', componentId = 3 },
7    pants      = { slot = 16, type = 'component', componentId = 4 },
8    shoes      = { slot = 17, type = 'component', componentId = 6 },
9    mask       = { slot = 18, type = 'component', componentId = 1 },
10    glasses    = { slot = 19, type = 'prop',      componentId = 1 },
11    earrings   = { slot = 20, type = 'prop',      componentId = 2 },
12    chain      = { slot = 21, type = 'component', componentId = 7 },
13    bracelet   = { slot = 22, type = 'prop',      componentId = 7 },
14    watch      = { slot = 23, type = 'prop',      componentId = 6 },
15    bag        = { slot = 24, type = 'component', componentId = 5 },
16    decals     = { slot = 25, type = 'component', componentId = 10 },
17}
  • Config.ClothingItems: maps each clothing type to its GTA slot, whether it is a component or a prop, and its component or prop ID. The generator uses type and componentId to count drawable and texture variations on the ped. This is internal wiring for ml_clothing. Do not edit unless you are changing how a component is handled.

Default Drawables

shared/config.lua
1Config.DefaultDrawables = {
2    male = {
3        mask = 0, hat = -1, earrings = -1, glasses = -1,
4        gloves = 0, pants = 21, shoes = 34, bag = 0,
5        undershirt = 15, jacket = 15, bodyarmor = 0,
6        chain = 0, bracelet = -1, watch = -1, decals = 0,
7    },
8    female = {
9        mask = 0, hat = -1, earrings = -1, glasses = -1,
10        gloves = 0, pants = 15, shoes = 35, bag = 0,
11        undershirt = 15, jacket = 15, bodyarmor = 0,
12        chain = 0, bracelet = -1, watch = -1, decals = 0,
13    },
14}
  • Config.DefaultDrawables: the "default outfit" drawable per type and gender. In standard random mode the generator re-rolls to avoid handing out this exact drawable, so players do not receive the plain default look. When only one valid drawable exists it is given anyway.

Standard Pack Items

The 15 standard packs are fixed and do not appear as a config table you edit. Each pack_<type> gives one random clothing item of that type. The mapping is documented in the config file comments:

  • pack_mask gives a random mask (component 1)
  • pack_hat gives a random hat (prop 0)
  • pack_earrings gives random earrings (prop 2)
  • pack_glasses gives random glasses (prop 1)
  • pack_chain gives a random chain (component 7)
  • pack_undershirt gives a random undershirt (component 8)
  • pack_jacket gives a random jacket (component 11)
  • pack_pants gives random pants (component 4)
  • pack_bodyarmor gives random body armor (component 9)
  • pack_bracelet gives a random bracelet (prop 7)
  • pack_watch gives a random watch (prop 6)
  • pack_bag gives a random backpack (component 5)
  • pack_shoes gives random shoes (component 6)
  • pack_gloves gives random gloves (component 3)
  • pack_decals gives random decals (component 10)

Register these in ox_inventory as shown on the Installation page, then give them to players through shops, loot, or crafting.

Custom Packs

shared/config.lua
1Config.CustomPacks = {
2    -- packs go here, all examples are commented out by default
3}
  • Config.CustomPacks: themed packs you define. Ships empty (only commented examples). Each entry is keyed by the ox_inventory item name and must be registered in ox_inventory with client = { export = 'ml_random_cloth.useCustomPack' }, the same way standard packs use ml_random_cloth.usePack. A pack has a label, an optional giveAll flag, and an items table in one of three formats. A pack must use one format, not a mix.

Format 1, specific drawables per gender. Picks one random drawable from the list:

shared/config.lua
1military_backpack_pack = {
2    label = 'Military Backpack Pack',
3    items = {
4        bag = {
5            male   = { 30, 45, 59, 80 },
6            female = { 44, 32, 46, 77 },
7        },
8    },
9},

Format 2, fixed drawable and texture as a tuple {drawable, texture}:

shared/config.lua
1pants = {
2    male   = { {12, 2} },              -- drawable 12, texture 2
3    female = { {15, 0}, {18, 1} },     -- random between two combos
4},

Format 3, plain random. A string array; each type rolls a fully random drawable from the ped model:

shared/config.lua
1starter_clothing_pack = {
2    label = 'Starter Pack',
3    items = { 'jacket', 'pants', 'shoes' },
4},
  • label: display name, used in debug output.
  • giveAll = true: gives one item for every type in the pack.
  • giveAll = false or omitted: gives one random item type from the pack. This is the default.
  • items: either a keyed table (formats 1 and 2, one entry per clothing type with male and female lists) or a string array (format 3).
Gender lists are independent

For keyed packs, a type only produces an item for a gender if that gender has a non-empty list. When giveAll = true, the server counts how many types have drawables for the player's gender and expects exactly that many items back, so leaving one gender empty is valid.