[REQUEST] Airsoft guns

Would anyone be able to make the Mk2 guns not do damage so players could have airsoft wars if they wanted to? I thought this would be pretty cool.

Hey man i can try to make it it is an great idea

1 Like

Thank you very much. I have started classes on coding but I have very little knowledge of it.

You can do this by just streaming the meta and adjusting it. I’ve made the minigun do no damage and be super inaccurate.

There’s a post here about snowball meta which is essentially the basis for what you’re asking for.

2 Likes

How would I stream the meta???

Like any other resource. Just google where the meta file is and use open IV to extract it.

2 Likes

You could also use this native :

// 0x4757F00BC6323CFE
// SetWeaponDamageModifier
void _SET_WEAPON_DAMAGE_MODIFIER(Hash weaponHash, float damageAmount);

weaponHash in your case will be the “WEAPON_THEONEYOUWANT_MK2” like “WEAPON_PISTOL_MK2”

2 Likes

Thank you :slight_smile:

Where would I put this in at?

Client script

Where can I write that at?

You just create a client.lua and paste that. Then create a fxmanifest.lua Fairly simple

So, I would make a folder. make the client.lua and paste that in there. Then just put the manifest in a __resource?

Also would I need to do a server.lua?

So to this how would I change the damage. As in
“WEAPON_PISTOL_MK2” I get that but then would I just do.

“WEAPON_PISTOL_MK2”, float 1.0?

No, you would have to set :
SetWeaponDamageModifier(“WEAPON_PISTOL_MK2”, 0.1) as it is a multiplier so if default damage are something like 30, that would mean 3 damage per bullet (Keep in mind that there is some “bonus/malus” depending on where you Hit, headshot will do more damage.
You could even go lower if you want, i know that 0.05 does works so… tweak it until you are happy with it

So I would just simply write that in a client or server.lua script for whatever weapon I want?? Also thank you very much for being patient with me. I am currently taking lessons on coding.

Wait, i did it for you, code is commented so you can add your own and understand it.
Here is a pastebin for the snippet : https://pastebin.com/wU5NuCm0

If you still don’t know how to use it… here is the full resource, download it, put the folder vscustomdamage in your “resources” folder and start it on your server.cfg vscustomdamage.zip (1.0 KB)

Thank you very much. I can not tell you enough how helpful you guys have been. :slight_smile:
I cant believe I did not catch on. That is simple code. Thank you again though. Also one more thing, where did you learn to code fivem? I am very interested in it and would love to be as skilled as you.

Also is this server sided???