[RELEASE] Flashbang

Tried to answer but my post didn’t get approved. Go through the client script (source code), make the changes you want and compile it into a dll. I’m afraid you won’t get around some programming knowledge to do that. :slight_smile:

*responded to the other guy.

Is it possible to add it in qb-core? As much as i try i always get the same result and that is when you trow it it will disappear. Can anyone help me with that?

Thank you

ik im late but when i throw it nothing happens

Any errors client/server side?

no just doesnt do anything

Try throwing it and then check the console. This might be a runtime error.

ok give me a second

Anything?

still same results

If the video doesnt load for anyone else. I was able to locate the video by doing some :magic_wand: stuff
https://streamable.com/15hlv

2 Likes

same here. throw it and it disappears.

for all the people with the QBCORE- this is how you make it work.

add this to qbcore/shared/weapons.lua

[weapon_flashbang] = {[‘name’] = ‘weapon_flashbang’, [‘label’] = ‘flashbang’, [‘ammotype’] = nil, [‘damagereason’] = ‘Bombed / Exploded / Detonated / Blew up’},

add this to qbcore/shared/items.lua

[‘weapon_grenade’] = {[‘name’] = ‘weapon_grenade’, [‘label’] = ‘Grenade’, [‘weight’] = 1000, [‘type’] = ‘weapon’, [‘ammotype’] = nil, [‘image’] = ‘images/weapon_grenade.png’, [‘unique’] = true, [‘useable’] = false, [‘description’] = ‘A handheld throwable bomb’},

add this to qb-weapons/client/main.lua inside of lines 180-181

                        elseif QBCore.Shared.Weapons[weapon]["name"] == "weapon_flashbang" then
                            TriggerServerEvent('QBCore:Server:RemoveItem', "weapon_flashbang", 1)

replace line 449 inside of qb-inventory/client/main.lua with this

elseif weaponName == "weapon_stickybomb" or weaponName == "weapon_pipebomb" or weaponName == "weapon_smokegrenade" or weaponName == "weapon_flare" or weaponName == "weapon_proxmine" or weaponName == "weapon_ball"  or weaponName == "weapon_molotov" or weaponName == "weapon_grenade" or weaponName == "weapon_flashbang" or weaponName == "weapon_bzgas" then

ENJOY!

3 Likes

can you correct the way it works, i think you create a loop and put the ms very high !

What do you mean?

The script uses the wait command to time the effects HOWEVER the latest version stacks those effects properly when hit in succession. I hope that answers your question. :slight_smile:

the script is not even use and i have 0.08ms in ressource using

Do you mean it doesn’t work for you?

0.08ms is 0.00008 seconds. Is it really high compared to other recources? Obviously it is still going to run if there are no runtime errors.

It’s high for a script not use all the time.

Better optimizations better server.

It’s should be not like that, I have much bigger script and they use 0.01