> For the complete documentation index, see [llms.txt](https://wxn-studios.gitbook.io/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wxn-studios.gitbook.io/documentation/fivecraft-scripts/weapon-repairs/installation/config-file.md).

# Config File

I've designed the configuration to be as flexible as possible, giving you full control over how the script looks and feels on your server. All of these settings are located in `shared/sh_config.lua`.

I've broken down each section below to explain exactly what everything does so you can tweak it to your liking.

## 🌍 Global Settings

These are the core settings that affect the entire resource.

```lua
Config.Debug = false        -- Set to true if you're having issues; I've added detailed logging to help you troubleshoot.
Config.Language = 'en'      -- Choose your language: 'en', 'fr', 'es', or 'de'.
Config.Notify = 'ox'        -- How do you want to notify players? Options: 'ox', 'esx', 'qb', or 'custom'.
```

{% hint style="info" %}

* For custom notifications, see [Notifications](/documentation/fivecraft-scripts/weapon-repairs/installation/notifications.md).
* For Discord logs setup, see [Webhooks](/documentation/fivecraft-scripts/weapon-repairs/installation/webhooks.md).
  {% endhint %}

## 🎨 Interface & Branding

I know how important it is for a script to match your server's aesthetic. Here you can change the text, notification titles, and even the progress bar style.

```lua
Config.Interface = {
    BrandName = 'FiveCraft',    -- The name displayed at the top of the UI.
    Title = 'Weapon Bench',     -- The subtitle or specific bench name.
    
    Notifications = {
        title = 'Weapon Service', -- The title used in ox_lib notifications.
        position = 'top',         -- Where notifications appear ('top', 'top-right', etc.).
        icon = 'wrench'           -- The FontAwesome icon used in notifications.
    },
    
    Progress = {
        Type = 'circle',      -- Choose 'bar' for a standard bar or 'circle' for a radial progress.
        Position = 'bottom',  -- Where the progress indicator appears.
        Duration = 5000,      -- How long (in ms) the repair takes.
        Label = 'repairing'   -- The text shown during repair (linked to locales).
    }
}
```

## 👁️ Interaction

I've included two ways for players to interact with the benches. You can stick to the modern "Third Eye" target system, or go old-school with a "Press E" text UI.

```lua
Config.Interaction = {
    Type = 'textui', -- Set this to 'target' (ox_target) or 'textui' (Press E).
    
    -- Settings for Text UI mode
    TextUI = {
        key = 'E',              -- The key to press.
        text = 'interact_text'  -- The text to display (linked to locales).
    },
    
    -- Settings for Target mode
    Target = {
        enabled = true,
        icon = 'fa-solid fa-screwdriver-wrench',
        label = 'access_bench', -- The label shown in the target menu.
        distance = 2.0          -- How close they need to be.
    },
    
    -- I've set this up to automatically work with these models.
    -- If you have custom bench props, just add their hashes here!
    Models = {
        `gr_prop_gr_bench_02a`,
        -- `prop_custom_bench`, 
    }
}
```

## 💰 Pricing & Materials

This is where you balance your economy. I used a "Bracket" system here. Basically, the script looks at the weapon's durability and finds the first bracket that matches.

{% stepper %}
{% step %}

#### Step: Check weapon durability

The script checks the weapon's durability percentage.
{% endstep %}

{% step %}

#### Step: Iterate pricing brackets

It looks through `Config.Pricing.Brackets` from top to bottom.
{% endstep %}

{% step %}

#### Step: Use matching bracket

It uses the cost of the first bracket where the durability is **greater than** `min_percent`.
{% endstep %}
{% endstepper %}

```lua
Config.Pricing.Brackets = {
    -- Tier 1: Light damage (90% - 100%)
    -- If durability is > 90%, it only costs 6 Iron.
    { min_percent = 90, materials = { { name = 'iron', count = 6 } } },
    
    -- Tier 2: Heavy damage (0% - 90%)
    -- If it's below 90%, it falls to this bracket. Costs are higher.
    { min_percent = 0,  materials = { { name = 'iron', count = 25 }, { name = 'steel', count = 10 }, { name = 'copper', count = 10 } } },
}
```

## 📍 Workstations (Locations)

You can place static benches anywhere in the world. I've made this easy to configure.

```lua
Config.Workstations = {
    {
        pos = vector3(4448.0, -4494.0, 4.2), -- The coordinates.
        rot = 201.0,                         -- The rotation (heading).
        createProp = false,                  -- Should I spawn a prop here? (Set true if there isn't one already).
        model = `gr_prop_gr_bench_02a`,      -- The model to use/detect.
        isFree = false,                      -- Set to true if you want free repairs at this specific location.
        
        -- Map Blip Settings
        blip = {
            active = false,          -- Set to true to show on the map.
            id = 402,                -- Sprite ID (Repair shop).
            color = 5,               -- Color ID.
            text = 'Weapon Repairs'  -- Blip name.
        }
    }
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://wxn-studios.gitbook.io/documentation/fivecraft-scripts/weapon-repairs/installation/config-file.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
