[Help Needed] Weapon on back

hello am using this script, but its giving me a performance warning and am wondring if someone could look at it for me, i have asked the guy that made the script but he is not replaying.
have also tried the esx_realweapon but its buggy that the gunes dosent show on your back :slight_smile:
when its running everyone on the server gets 20-30 fps :frowning:

https://github.com/OfficialDarkzy/weaponsforback/tree/master/weaponsonback (NOT MY SCRIPT)

I dont know if this fix it 100%…
But you can try to set some Delay on it, like if you set Citizen.Wait to 1000, and set Wait to 1000 :))
Maybe that fixes your problem

  • Cheers

I can see quite some unnecessary native calls every frame.

For example: https://github.com/OfficialDarkzy/weaponsforback/blob/master/weaponsonback/main.lua#L8-L12

You don’t need to get the hash key of the weapons every frame since the config doesn’t change. That and other improvements can be made.

To get a better understanding on how to improve the resource, have a look at this topic: [Best practice] Improve your resource performance

thank you, i will have a look :slight_smile: