Is it possible to add attachments to an MK2 firearm?

Hello!

I have been trying to wrap my brain around this as it works for legitimately every firearm I have placed except for these new MK2 weapons… This is my script snippets:
For the attachments. I cannot purchase them because the script is looking to compare hash-codes… They are clearly the same but FiveM seems to be changing the HashKey every time the server restarts. I found this out by printing out the hash-key to the console client-side and also server-side… Would this be a FiveM Bug or has anyone else been able to figure out this?

Any help is appreciated!

            ["MK2 Pistol"] = {
                {name = "Flashlight", value = "COMPONENT_AT_PI_FLSH_02", price = 200, weapon_hash = 3219281620},
                {name = "Camo", value = "COMPONENT_PISTOL_MK2_CAMO_10", price = 200, weapon_hash = 3219281620}
            },

For the store itself:

{ name = "MK2", type = "weapon", hash = 3219281620, price = 1250, legality = "legal", quantity = 1, weight = 15 },

EDIT:
I was able to bypass the check for haskey by giving it what the server THINKS is the hashkey: -1075685676 … But still the attachments do not go on.

Just use this and add weapons that are missing

https://forum.cfx.re/t/release-esx-easy-weapon-accessories-add-and-remove-attachments

It’s not the fact that I cannot get the gun in the game… the attachments won’t attach.
It’s the fact that FiveM SEEMS to think like this for the mk2 pistol:
MK2 Pistol ACTUAL hash: 3219281620
MK2 Pistol THEORITICAL hash: -1075685676

Therefor, attempting to do anything is Actual =/= Theoritical

Have you been able to get your script working with the MK2?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.