Backpack Attachments

I’m excited to share my latest FiveM resource, Backpack Attachments! This script allows players to visually attach weapons and items to their characters’ backs, enhancing immersion and adding a new layer of customization to your roleplay server.

It’s standalone but works fine with:

  • qb-inventory
  • ox-inventory
  • esx-inventory
  • codem-inventory

Features:

  • Automatically attaches specified weapons and items to a player’s back.
  • Supports both weapons and non-weapon items, with customizable attachment points and positions.
  • Fully configurable via a simple configuration file.
  • Optimized and lightweight, ensuring minimal impact on server performance.
  • Open source: You can convert it to any framework you like and remove the QBCore/ESX requirement.
  • Component and tint support: All weapon components and tints are preserved when attached.
  • Low usage: The script has minimal performance impact.
  • No bugs: Eliminates issues such as vehicle explosions or bullets passing through objects.

How It Works:

  • Weapons and items are automatically detected in the player’s inventory.
  • The script attaches the item or weapon to the player’s back based on predefined configurations.
  • Supports custom positioning, rotation, and bone attachment for each item.

Installation:

  1. Download the script and place it in your resources folder.
  2. Add ensure w-backitemdisplay to your server.cfg.
  3. Customize the configuration file to fit your server’s needs.

Preview:

  • SMG with pink tint.

New in the Latest Update:

  • Framework Independence: The script no longer requires any specific framework or inventory system to function and can now work independently.

  • Custom Props: There’s now an option to set a separate prop for items like a katana, making them more visually appealing and customizable.

Download: GitHub repository

Code is accessible Yes
Subscription-based No
Lines (approximately) 300+
Requirements N/A
Support No
6 Likes

Invalid link

fixed

Standalone?

Yes, it’s open source. You can edit the editable.lua file for your inventory, such as qs-inventory, and so on.

not working with ESX ??

I don’t quite understand how I can use this script for Standalone. Could you please help me with this?

It seems that some users may not have the necessary knowledge to convert the script to other frameworks like ESX. I understand the challenge, and I’m considering adding this option in a future update. If you’re using a specific framework or inventory system, please let me know so I can ensure compatibility. While I initially mentioned that there would be no support in the script’s description, due to the positive response and since this is my first script, I’m willing to make these adjustments.

1 Like

This is really nice of you, thanks.
I would love to see a codem-inventory system adaptation if possible. thank you for your work!

Just an idea you probaly want to add in option to enable/disable showing items/weapons trogh event or export. There probaly wil be some use cases where this would be nice, first thing comes to mind would be clothing stores etc.

I still don’t understand how I can use your script for standalone. Make a standalone version so that other servers can use this seemingly cool script as well

In this script, several updates have been added for the Backpack Attachments:

  1. exports["w-backitemdisplay"]:active(state):
    This function allows you to toggle the visibility of weapons on the back of all players. If the state is set to true, the function will activate and start monitoring the players to hide their weapons. If set to false, it will stop hiding the weapons.

    • When called, it checks if the current state matches the requested state. If they are the same, the function does nothing (return). If the state changes to true, it activates a function to monitor active players and hide their weapons.
  2. exports["w-backitemdisplay"]:showmyweapons(state):
    This function controls whether your own weapons are visible to other players. By triggering a server event, it updates the display of your weapons for other players based on the state you pass in.

    • When called, it sends a request to the server to either show or hide your weapons from other players.

New features in this update:

  • Framework Independence: The script no longer requires any specific framework or inventory system to function and can now work independently.

  • Custom Props: There’s now an option to set a separate prop for items like a katana, making them more visually appealing and customizable.

This update enhances your control over the visibility of weapons and introduces new customization options to improve the visual experience.

1 Like

You have made the script standalone. That’s very cool. Question. Is there any way to add addon weapons to the config? Maybe I read something wrong, but after trying different names and different methods I could not add my weapon. Can you tell me how exactly?

You should modify both config.lua and data.json.

Here is an example of data.json,

"randomnumber": {
  "HashKey": "WEAPON_KATANA",
  "NameGXT": "",
  "DescriptionGXT": "",
  "Name": "",
  "Description": "",
  "Group": "",
  "ModelHashKey": "",
  "DefaultClipSize": 1,
  "AmmoType": "",
  "Components": {},
  "Tints": [],
  "LiveryColors": [],
  "DLC": ""
},

when we remove the weapon from the inventory, the weapon is still on the player’s back

Enable BetterSync in config file

1 Like

chrome-capture-2024-11-19 (6)
QB-CORE It didn’t help
qb-inventory
build_server_windows 11012