> For the complete documentation index, see [llms.txt](https://tyrix.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tyrix.gitbook.io/docs/script-resources/tyrix-business/configuration.md).

# Configuration

Tyrix Business splits its configuration across two files:

* `config.lua` - client + server settings (loaded as `shared_scripts`). Anything a client needs to know lives here.
* `config_server.lua` - server-only secrets (Discord webhook URLs). Not accessible from the client.

## Bridge

Framework and integration bridges. `system` selects the backend for each; each family also accepts `custom = { ... }` if you're wiring your own.

```lua
Config.Bridge = {
    Notifications = { system = 'ox_lib' },                 -- 'ox_lib' | 'vms_notify' | 'esx' | 'custom'
    BossMenu      = { system = 'tyrix_multijob' },         -- 'esx' | 'wasabi' | 'tyrix_multijob' | 'custom'
    Clothing      = { system = 'illenium-appearance' },    -- 'illenium-appearance' | 'fivem-appearance' | 'esx_skin' | 'custom'
    Garage        = { system = 'jg-advancedgarages' },     -- 'jg-advancedgarages' | 'cd_garage' | 'custom'
    VehicleKeys   = { system = 'wasabi_carlock' },         -- 'none' | 'wasabi_carlock' | 'mk_vehiclekeys' | 'Renewed-Vehiclekeys' | 'custom'
}
```

## Inventory (stashes)

Every stash type has global slots + maxWeight defaults; features that support per-instance overrides let admins tune those inline in the Business Manager.

```lua
Config.Trays     = { slots = 10, maxWeight = 10000  }   -- public counters
Config.Storage   = { slots = 50, maxWeight = 100000 }   -- job-locked
Config.TrashCans = { slots = 10, maxWeight = 50000  }   -- auto-clearing
Config.Freezer   = { slots = 50, maxWeight = 100000 }   -- pauses item decay while inside
Config.Lockers   = { slots = 50, maxWeight = 100000 }   -- per-character private (job + character identifier)

Config.Boxes = {
    defaultSlots        = 5,
    defaultMaxWeight    = 50000,
    uses                = 10,                    -- per-box open limit; 0 = unlimited
    fallbackImageName   = 'restaurant_box.png',
    fallbackLabel       = 'Business Box',
    fallbackDescription = 'A portable storage box.',
    recipeOnly          = true,                  -- only recipe outputs may be inserted
    blacklistedItems    = { 'money', 'black_money' },
    blacklistedPrefixes = { 'WEAPON_', 'ammo-' },
    allowedImageHosts   = { 'r2.fivemanage.com', 'i.imgur.com', 'cdn.discordapp.com' },
}
```

See [Item Setup](broken://pages/facab686e9e33eb099bffcc123ab90910d79f56d) for the one-time `ox_inventory` step the `business_box` item needs.

## Products

Bosses create custom products from an in-world **Product Manager** point (placed by an admin like any other feature).

```lua
Config.Products = {
    enabled        = true,   -- Master toggle. false hides the feature everywhere.
    maxPerBusiness = 25,     -- Product cap per business.

    -- Product type -> base ox_inventory item. Each must exist in
    -- ox_inventory/data/items.lua (see Item Setup).
    baseItems = {
        drink   = 'business_drink',
        food    = 'business_food',
        joint   = 'business_joint',
        alcohol = 'business_alcohol',
    },

    -- Ingredient pool offered to bosses. Non-empty = ONLY these items are
    -- selectable. Empty table = any valid item (minus the blacklist).
    -- Enforced server-side; the client picker filter is cosmetic.
    allowedIngredients = { 'water', 'sugar', 'chocolate', 'milk', 'ice' },

    -- Always rejected, even when allowedIngredients is empty.
    ingredientBlacklist = { 'money', 'black_money' },

    maxIngredients      = 6,     -- Max distinct ingredients per product.
    maxIngredientAmount = 20,    -- Max quantity per ingredient.

    craftTime = 5000,            -- ms. Craft duration for boss-created products.
    maxAmount = 5,               -- Max craft-at-once amount.
}
```

Product images are validated against the shared `Config.AllowedImageHosts`.

**Ingredient pool.** Leaving `allowedIngredients` populated is the safer default — bosses can only build recipes from ingredients you've approved. Set it to `{}` to let them use any registered item except the blacklist.

**Adding a product type.** Add an item to `ox_inventory/data/items.lua` and a matching entry in `baseItems`. The new type appears in the boss's Product Type dropdown automatically.

**Where the boss finds it.** An admin places a Product Manager feature from the Business Manager. Employees see nothing; only players whose grade is in `Config.BossGrades` get the third-eye option, and the server re-verifies that on every product event.

## Cash Register

```lua
Config.Registers = {
    nearbyPlayerDistance = 5.0,
    businessCommission   = 0.30,  -- 30% base to society, 70% to worker; tips 100% to worker
}
```

Individual registers can override the commission when placed. See [Cash Register & Tipping](/docs/script-resources/tyrix-business/cash-register.md) for the full money flow.

## Supply Run

```lua
Config.SupplyRun = {
    vehicleModel     = 'rumpo2',
    businessCooldown = 5,     -- minutes (0 disables)
    maxItemQuantity  = 500,
    abandonTimeout   = 120,   -- seconds
    Payment          = { EmployeeAccount = 'cash' },  -- 'cash' or 'bank'
    feeCalculation   = { perItemMultiplier = 0.25 },
}
```

## Home Delivery

```lua
Config.Delivery = {
    Cooldown                 = 60,   -- per-player seconds between successful deliveries
    MaxConcurrentPerBusiness = 2,
    HandoverDistance         = 3.0,
    PedSpawnDistance         = 30.0,
    Payment = {
        Recipient       = 'employee',  -- 'employee' or 'business'
        EmployeeAccount = 'cash',      -- 'cash' or 'bank'
    },
    -- Handover locations are picked at random. Populate with vec4() coords.
    DeliveryLocations = { --[[ vec4(x, y, z, w) entries ]] },
}
```

Full walkthrough on the [Home Delivery](/docs/script-resources/tyrix-business/home-delivery.md) page.

## Skill Check

```lua
Config.SkillCheck = {
    enabled       = true,
    difficulty    = { 'easy', 'easy' },   -- ox_lib difficulty spec
    keys          = { 'e' },
    defaultChance = 25,                   -- % chance a craft triggers the skill check
}
```

## Admin access

```lua
Config.AdminGroups = { 'god', 'superadmin', 'admin' }  -- framework groups

Config.AdminIdentifiers = {
    -- Raw FiveM identifiers with prefix, matched 1:1 against the player's identifiers.
    -- 'license:abc1234...',
    -- 'discord:123456789...',
    -- 'steam:110000112345678',
    -- 'fivem:1234567',
}

Config.BossGrades = { ['boss'] = true, ['owner'] = true, ['chief'] = true }
```

Any player in an `AdminGroups` group OR matching an `AdminIdentifiers` entry can open the Business Manager. `BossGrades` names the grades that count as "boss" for feature gating (boss menus, box-image edit, etc.).

## Business creator command

```lua
Config.BusinessCreator = { command = 'business' }
```

Change this if `/business` collides with something on your server.

## Discord webhooks (`config_server.lua`)

Server-only. One channel per log family; leave a URL blank to disable that channel.

```lua
ConfigServer.DiscordWebhook = {
    enabled  = true,
    botName  = 'Business System',
    webhooks = {
        success      = '',  -- Successful crafts
        failure      = '',  -- Failed crafts
        cancel       = '',  -- Cancelled operations
        exploit      = '',  -- Exploit attempts
        business     = '',  -- Business create / delete
        jobs         = '',  -- Job + rank management (audit)
        feature      = '',  -- Feature add / update / delete
        recipe       = '',  -- Recipe changes
        transaction = '',   -- Cash register charges + tips
        shoppurchase = '',  -- Shop purchases
        supplyrun    = '',  -- Supply runs
        delivery     = '',  -- Home delivery
    },
}
```
