# Configuring this resource

### 📁 Installation

1. Download and add `MirrorParkStudios-ShieldSystem` to your server's `resources/` folder.
2. In your `server.cfg`, add:

   ```cfg
   ensure MirrorParkStudios-ShieldSystem
   ```
3. Edit `Shared/Config.lua` to match your server needs.
4. Restart the resource or the server to apply your changes.

***

### ⚙️ Configuration

All settings are controlled via `Shared/Config.lua`. Below is an explanation of each section:

***

#### 🔫 Weapon Settings

These settings determine what weapons are automatically given when a shield is equipped.

```lua
Config.PistolWeapon = `WEAPON_PISTOL`

Config.PistolWeaponComponents = {
    `COMPONENT_AT_PI_FLSH`
}

Config.BatonWeapon = `WEAPON_POBATON`
```

***

#### 💬 Command Options

These allow players to activate shields via chat commands.

```lua
Config.Commands = {
    Enabled = true,
    BallisticShield = "ballisticshield", -- /ballisticshield
    LongShield = "longshield",           -- /longshield
    ShortShield = "shortshield",         -- /shortshield
    ShieldUp = "shieldup"                -- /shieldup
}
```

You can change these command names to anything you'd like.

***

#### 📦 Export Options

These allow shields to be triggered from other scripts.

```lua
Config.Exports = {
    Enabled = true,
    BallisticShield = "ballisticshield",
    LongShield = "longshield",
    ShortShield = "shortshield",
    ShieldUp = "shieldup"
}
```

Example usage:

```lua
exports["MirrorParkStudios-ShieldSystem"]:ballisticshield()
```

***

#### 🔒 Access Restriction

This function allows you to restrict who can use the shield commands or exports.

```lua
Config.RestrictionCheck = function()
    -- Insert your logic here to restrict access.
    -- Example (QBCore):
    -- return QBCore.Functions.GetPlayerData().job.name == "police"

    return true -- Allow all users by default
end
```

Return `true` to allow access or `false` to block it based on your logic.
