> For the complete documentation index, see [llms.txt](https://betascripts.gitbook.io/betascriptsdocs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://betascripts.gitbook.io/betascriptsdocs/guides-to-install/editor/install.md).

# Install

🧥 BS\_Functionalwear

## Functional Wear Setup Guide

### ✅ Install Instructions

1. **Copy/Move Resource:**
   * Move the `BS_FunctionalWear` folder into your FiveM server's `/resources` directory.
2. **Configure:**
   * Open `BS_FunctionalWear/config.lua` and adjust values to suit your server.
3. **Add to `server.cfg`:**
   * Add this line **early** in your `server.cfg`:

     ```cfg
     ensure BS_FunctionalWear
     ```
   * Make sure this resource starts **before** any other resources that use its `nativefunctions` files.
4. **Integrate with Other Resources:**
   * If your resource changes ped appearance with:

     ```lua
     SetPedComponentVariation
     SetPedPropIndex
     ClearPedProp
     ```
   * Choose one of the two setups below:

***

### 🟢 Recommended Setup (Native Functions Replacement)

1. **Add Files to Manifest:**
   * Add the files from `BS_FunctionalWear/nativefunctions` into your resource's `fxmanifest.lua`.
2. **Add These Lines:**

   ```lua
   client_script "@BS_FunctionalWear/nativefunctions.js"
   client_script "@BS_FunctionalWear/nativefunctions.lua"
   ```

***

### 🔴 Unrecommended Setup (Client Event)

1. **Trigger Event After Each Appearance Change:**

   ```lua
   TriggerEvent("BS_FunctionalWear:wearChange")
   ```

***

### 🧢 Usable Items (ox\_inventory)

#### 📦 Item Definition (`ox_inventory/data/items.lua`)

```lua
["pieceofclothing"] = {
  label = "Clothing",
  weight = 0,
  stack = false,
  close = true,
  description = "Piece of clothing",
  consume = 1,
  allowArmed = true,
  client = {
    export = "BS_FunctionalWear.DonClothing"
  }
}
```

> 🔄 You can rename `label`, `description`, `close`, and `allowArmed`. Just make sure the `name` matches what's defined in `config.lua`.

***

#### 🏪 Shop Definition (`ox_inventory/data/shops.lua`)

```lua
FunctionalClothes = {
  name = "Clothing",
  blip = {
    id = 73,
    colour = 2,
    scale = 0.7
  },
  inventory = {
    {
      name = "pieceofclothing",
      price = 10,
      metadata = {
        label = "Mask 1:0",
        key = 1,
        value = 1,
        extra = 0,
        description = "Mask 1:0",
        image = "functional_mask"
      }
    },
    {
      name = "pieceofclothing",
      price = 10,
      metadata = {
        label = "Gloves 1:0",
        key = 3,
        value = 1,
        extra = 0,
        description = "Gloves 1:0",
        image = "functional_gloves"
      }
    },
    {
      name = "pieceofclothing",
      price = 10,
      metadata = {
        label = "Pants 1:0",
        key = 4,
        value = 1,
        extra = 0,
        description = "Pants 1:0",
        image = "functional_pants"
      }
    },
    {
      name = "pieceofclothing",
      price = 10,
      metadata = {
        label = "Bag 1:0",
        key = 5,
        value = 1,
        extra = 0,
        description = "Bag 1:0",
        image = "functional_bag"
      }
    },
    {
      name = "pieceofclothing",
      price = 10,
      metadata = {
        label = "Shoes 1:0",
        key = 6,
        value = 1,
        extra = 0,
        description = "Shoes 1:0",
        image = "functional_shoes"
      }
    },
    {
      name = "pieceofclothing",
      price = 10,
      metadata = {
        label = "Accessory 1:0",
        key = 7,
        value = 1,
        extra = 0,
        description = "Accessory 1:0",
        image = "functional_accessory"
      }
    },
    {
      name = "pieceofclothing",
      price = 10,
      metadata = {
        label = "Shirt 1:0",
        key = 8,
        value = 1,
        extra = 0,
        description = "Shirt 1:0",
        image = "functional_shirt"
      }
    },
    {
      name = "pieceofclothing",
      price = 10,
      metadata = {
        label = "Armor 1:0",
        key = 9,
        value = 1,
        extra = 0,
        description = "Armor 1:0",
        image = "functional_armor"
      }
    },
    {
      name = "pieceofclothing",
      price = 10,
      metadata = {
        label = "Decal 1:0",
        key = 10,
        value = 1,
        extra = 0,
        description = "Decal 1:0",
        image = "functional_decal"
      }
    },
    {
      name = "pieceofclothing",
      price = 10,
      metadata = {
        label = "Jacket 1:0",
        key = 1,
        value = 1,
        extra = 0,
        description = "Jacket 1:0",
        image = "functional_jacket"
      }
    }
  }
}
```
