Skip to content

10% off shop orders, applied at checkoutBlack Friday: 30% off until Dec 1Server templatesServer templates

RPScripts

Weapon On Back for FiveM

By Luke, RPScripts

Weapon On Back
On this page

The original bag-based Weapon On Back description matches Energi’s ef-weaponback release from April 2023. The source checks whether the player has the bag item: without it, configured unequipped weapons can appear on the back; with it, attached weapon props are removed.

Actual resource and database setup

The creator repository contains __resource.lua, cl.lua, sv.lua and sql.txt. Use the actual ef-weaponback resource folder with the manifest directly inside it. Load the ESX dependency before starting the resource.

The FiveM manifest reference names fxmanifest.lua as the current file and __resource.lua as its previous name, so test the resource on your server before it goes live.

The server still obtains ESX through the older esx:getSharedObject event. Check your ESX version before installation; current compatibility was not tested. The supplied SQL inserts bag using legacy limit, rare and can_remove columns and has no duplicate guard. Back up the database and compare the actual items schema and existing bag item before adapting or importing it.

Weapons and clothing are handled differently

The client checks GTA weapon ownership with HasPedGotWeapon and the selected weapon. This does not automatically support inventories that represent weapons only as items. The configurable weapon-model list and attachment offsets are in cl.lua; the bag item lookup is in sv.lua.

Every two seconds the client asks the server to check the bag. The response sets clothing component 5 to drawable 45 when a bag exists or 0 when it does not, with texture 0. That can override a player’s chosen bag appearance and may not fit every ped model. It is not a general clothing-shop bag detector.

Test before relying on it

The creator later said a clothing-based update was done, but the checked public repository remains at its April 15, 2023 revision. Do not assume the requested update is included. Test weapon switching, bag changes, character replacement and resource restarts with your inventory and clothing system. The full small archive passed integrity checks and all source files were read; no SQL or FiveM gameplay was executed.

Original ef-weaponback source

Creator release and clothing-update discussion