[RELEASE] Flashbang

is this a spawn only item or can i add it to police loadout or shops

The script works if you have a weapon called “WEAPON_FLASHBANG” in your weapon wheel. So basically yeah this script could be used in shops / police loadouts / etc since this is an addon weapon.

1 Like

How to change effect the flashbang? make aftertime 0?

1 Like

I made a 9-Bang a few months ago, and I know a bit about metas if you need some help.
I haven’t personally tested this but I believe what you are looking for as far as
Weapon is named Tear Gas (I don’t know metas well enough to fix it)
is this line here.
<StatName>BZGAS</StatName>
Found nearing the bottom of the “WEAPON_WEAPONNAME”

Weapon has smoke on it when thrown (It is another part that I have no idea how to fix)
Under your weapons “AMMO_WEAPONNAME” there is a block of Fuse and Trail FX

          <TrailFx>proj_grenade_smoke</TrailFx>
          <TrailFxUnderWater />
          <TrailFxFadeInTime value="0.000000" />
          <TrailFxFadeOutTime value="0.000000" />
          <PrimedFx>proj_grenade_smoke</PrimedFx>

I’m pretty sure this is what you are looking for to remove that smoke trail.

Weapon has a timer to hold it (No idea how to fix that either)
I believe you are looking for
<LifeTime value="5.000000" />
Which is also under the “AMMO_WEAPONNAME”

And as for
When restarting the resource it may throw an error trying to give yourself WEAPON_FLASHBANG. I think it is caused by the metas being reloaded. There really should be no reason to restart the resource.
“weapons.meta” act like “vehicles.meta” once you have cached them you will need to restart your client in order to take the effect. (What I’ve noticed after hours of testing, I could be wrong.)

Haven’t updated recently but this is what my 9 Bang looks like. I like the explosion you used, and I think I should update mine to use the same because it looks like actual gas disbursement, other then my “Grenade like” explosion. @xander1998

how to change the sound of the item?

I would say the bottom one if you need my input, since it will act more as a stun weapon rather than just barely blinding you and having full body function…

In reality a flashbang could kill, the explosion is so powerful you wont be able to function properly for a bit, so the closest to that i guess is the 2nd video you showed, with the camera bouncing all over

The explosion is perfect tbh, maybe just lower the radius of the fire. it looks perfect as it is tbh, and i would love if you’d also share it so people test it out.

Ported a model from CSGO as well to make it all more official. :stuck_out_tongue:

Fixed up the META’s for it to be truly it’s own weapon. Now it won’t spawn that smoke n all that you mentioned & has a name too.

Anyone who wishes to have this version, or if you wanna combine it with this post, here it is. Includes the model as well. I lowered the life time too, which isn’t shown in the video.

flashbang.rar (5.7 MB)

I can download it and push it straight to the github repo. I just gotta edit some stuff to add credits now if that is what you want.

1 Like

yeah that’s fine :call_me_hand:

Alright should be pushed and added to 3.0 download in like 20 minutes.

Update 3.0

  1. Model Ported
  2. Metas Redone

(I converted that Lua code into the base C# resource to keep the code similar throughout).

Credits - @ImTrevorTbh

Can’t give myself the flash anymore, was working befor the update

I can pack it into a resource properly and release it.

Try to delete the old cache file for the flashbang and try. The download was directly archived from my server that I tested it on before I released it.

Okay, i found out that the Github version was missing some files from the older version.
Btw, i have an issue, giving myself the flashbang using /giveweapon work wells and the flashbang have no issue. BUT it’s impossible to add it on a menu, i did try to add it into the config file of esx_policejob as a weapon to buy, got errors. I did try to add it manually into policejob objets, got errors too.
What am i doing wrong ? am i missing a step ?

thanks.

I’m having the same issue. Maybe because is not considered as a weapon / item ? In fact when you give yourself the flashbang appear +1 Undefined.

I saw that ESX have an weapon config file, i will try to add weapon_flashbang to it, maybe it’s the cause of the issue

The weapon was tested & had no issues when i released to xander, though this was done on FXServer, not ESX or anything. I do not mess with these frameworks, so i cannot be much help with that (if thats what you use.)

1 Like

The weapon doesnt have problems, the only thing is the implementation on the ESX to add the weapon to the menus, thanks the same :smiley: