# Installation > Setup guide for ML Random Cloth Category: RANDOM CLOTHING · Source: https://miciomods.it/docs/random-cloth-installation · Last updated: 2026-07-09 ## Overview ML Random Cloth is a companion resource for `ml_clothing`. It adds "pack" items that, when used, give a random clothing piece with a random drawable and texture written to the item metadata. It has no custom interface and no database of its own. ## Quick Start Add the resources to your `server.cfg` in this order. `ml_random_cloth` starts after `ml_clothing` because it hands the random clothing item to `ml_clothing` through the Bridge. **server.cfg** ```cfg ensure oxmysql ensure ox_lib ensure ox_inventory ensure ml_bridge ensure ml_clothing ensure ml_random_cloth ``` > **WARNING:** ml_clothing must be running > > The pack items give real clothing items such as `hat`, `jacket` and `pants`. Those items are defined and handled by `ml_clothing`. If `ml_clothing` is not started, the pack removes itself but the player receives nothing usable. Start `ml_clothing` before `ml_random_cloth`. ## Database > **INFO:** No database > > ML Random Cloth does not create or use any SQL table. There is nothing to import. All randomness happens at runtime and the result is stored in the given item's metadata by `ml_clothing`. ## Item Registration The 15 standard pack items must be registered in `ox_inventory`. Copy the block below into your `ox_inventory/data/items.lua`. Each item declares `client.export = 'ml_random_cloth.usePack'`, which is how using the item triggers the random-clothing logic. **ox_inventory/data/items.lua** ```lua ['pack_mask'] = { label = "Mask Pack", weight = 100, stack = false, client = { export = 'ml_random_cloth.usePack' } }, ['pack_hat'] = { label = "Hat Pack", weight = 100, stack = false, client = { export = 'ml_random_cloth.usePack' } }, ['pack_earrings'] = { label = "Earrings Pack", weight = 100, stack = false, client = { export = 'ml_random_cloth.usePack' } }, ['pack_glasses'] = { label = "Glasses Pack", weight = 100, stack = false, client = { export = 'ml_random_cloth.usePack' } }, ['pack_chain'] = { label = "Chain Pack", weight = 100, stack = false, client = { export = 'ml_random_cloth.usePack' } }, ['pack_undershirt'] = { label = "Undershirt Pack", weight = 100, stack = false, client = { export = 'ml_random_cloth.usePack' } }, ['pack_jacket'] = { label = "Jacket Pack", weight = 100, stack = false, client = { export = 'ml_random_cloth.usePack' } }, ['pack_pants'] = { label = "Pants Pack", weight = 100, stack = false, client = { export = 'ml_random_cloth.usePack' } }, ['pack_bodyarmor'] = { label = "Body Armor Pack", weight = 100, stack = false, client = { export = 'ml_random_cloth.usePack' } }, ['pack_bracelet'] = { label = "Bracelet Pack", weight = 100, stack = false, client = { export = 'ml_random_cloth.usePack' } }, ['pack_watch'] = { label = "Watch Pack", weight = 100, stack = false, client = { export = 'ml_random_cloth.usePack' } }, ['pack_bag'] = { label = "Bag Pack", weight = 100, stack = false, client = { export = 'ml_random_cloth.usePack' } }, ['pack_shoes'] = { label = "Shoes Pack", weight = 100, stack = false, client = { export = 'ml_random_cloth.usePack' } }, ['pack_gloves'] = { label = "Gloves Pack", weight = 100, stack = false, client = { export = 'ml_random_cloth.usePack' } }, ['pack_decals'] = { label = "Decals Pack", weight = 100, stack = false, client = { export = 'ml_random_cloth.usePack' } }, ``` The same block ships in `_INSTALL/ox_items.lua` with the `client.export` line already on every item, so you can paste it straight into `ox_inventory/data/items.lua`. > **TIP:** Custom packs need an export too > > Custom packs are registered in `ox_inventory` exactly like the standard packs, but each custom pack item uses `client = { export = 'ml_random_cloth.useCustomPack' }` while standard `pack_*` items use `client = { export = 'ml_random_cloth.usePack' }`. ## Verify Start the server and confirm the resource loaded without errors. With `Config.Debug = true` you will see a line like this in the server console: ```lua [ml_random_clothing] ml_random_cloth initialized (Framework: qbx) ``` Give yourself a pack and use it in-game: ```lua /giveitem [id] pack_jacket 1 ``` Using the item plays a 2.5 second progress bar labeled "Opening clothes...", then removes the pack and gives one `jacket` item with a random drawable and texture. **Troubleshooting** - Using a pack does nothing: confirm the item exists in `ox_inventory` with `client = { export = 'ml_random_cloth.usePack' }`. Without the export, `ox_inventory` has no code to run on use. - The pack is consumed but no clothing item appears: confirm `ml_clothing` is started and the target clothing item (for example `jacket`) is registered. The server calls `Bridge.CanCarry` before removing the pack, so a full inventory also stops the give. - Nothing happens and no progress bar shows: the resource found no valid drawable for that type on the current ped, or you are on cooldown. There is a 3 second server-side cooldown between pack opens per player. - Wrong language in the progress bar: set `Config.Language` in `shared/config.lua`. Supported values are `en` and `it`.