> For the complete documentation index, see [llms.txt](https://docs.menanak47.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.menanak47.com/multi-framework/ak47_switch.md).

# ak47\_switch

The ultimate weapon switch and full-auto attachment experience for FiveM servers.

{% embed url="<https://youtu.be/wb6TNPvu7JQ>" %}

Transform standard firearms into high-rate-of-fire variants using usable switch items, with seamless bidirectional removal returning the firearm and attachment intact. Built from the ground up utilizing `ak47_lib` for unified ESX, QBCore, and QBX compatibility and modern inventory metadata preservation.

***

### 🔥 Key Features

Designed to improve roleplay immersion and economy balancing:

#### 🔫 Multi-Weapon Conversion & Transitions

* **Dynamic Weapon Pairs:** Configure unlimited weapon conversions in `config.lua` (e.g., Combat Pistol to AP Pistol, Standard Pistol to Machine Pistol, MK2 pistols, or custom addon weapons).
* **Bidirectional Switch Removal ($B \rightarrow A$):** Players can detach the switch at any time using `/r_switch` (or via export), converting the firearm back to its base model and returning the switch item to their inventory.

#### 💾 Complete Metadata & Stat Preservation

* **Ammo & Serial Number Retention:** Retains accurate bullet counts, weapon serials, and custom info across weapon switches.
* **Durability & Quality Safeguards:** Preserves weapon wear, quality, and durability across switches in supported inventory systems (ox\_inventory, qb-inventory, ak47\_inventory, qs-inventory).

#### ⚙️ Deep Configuration & Gameplay Mechanics

* **Multiple Switch Items:** Assign different switch attachment items for specific weapon categories (e.g., Glock switches, rifle triggers) or use a single universal switch.
* **In-Hand or Inventory Detection:** Toggle whether the weapon must be actively drawn in hand or automatically detected from the player's inventory.
* **Custom Timers & Animations:** Configure distinct installation/removal durations per weapon alongside synchronized character animations, progress bars, and combat locks.

#### 🛠️ Technical Excellence

* **Multi-Framework & Inventory Support:** Seamlessly works with ESX, QB, and QBX frameworks, supporting ox\_inventory, qb-inventory, ak47\_inventory, qs-inventory, and more.
* **Highly Secure:** Built-in server-side exploit checks that validate item possession, weapon ownership, and carry capacity before completing any transformation.
* **Developer Exports & Modern Locales:** Includes client/server exports for integration with radial wheels, target systems, or custom crafting, powered by native `ak47_lib` JSON localization.

***

### 💻 Framework:

* ESX, QB, QBX

***

### ⚙️ Dependencies:

* ak47\_lib: <https://github.com/MenanAk47/ak47_lib/releases/latest>

***

### ⚙️ How To Install:

* Download ak47\_switch from your cfx portal.
* Add the script in your resources folder.
* Add items based on your framework instruction.
* Add item images into inventory.
* Start the script in your server.cfg below framework files.
* Make sure you have all dependencies.
* Restart the server.

***

### 🔗 Links & Support:

* **📖 Documentation:** <https://docs.menanak47.com/multi-framework/ak47_switch>
* **🛒 Buy Now (Tebex):** <https://menanak47.tebex.io/package/ak47_switch>
* **💬 Discord Support:** <https://discord.gg/menanak47>

***

### 📝 Note:

* We don't support custom framework. Make sure you are using official framework update.
* Renaming the script is not allowed. It may break the functionalities.
* Don't upload the script with FileZilla, Use Winscp if you are using FTP for file uploading
