Garry's Mod

Garry's Mod

NPCs / Players drop ammo on death
79 Comments
파반느 30 Jun @ 6:31am 
im having a bug where combines would drop health vials for no reason when my hp isn't at 100
Nerfentity 21 Jun @ 1:21pm 
Is there a way to make it so that they don't drop grenades?
Smytsidian 16 May @ 10:18am 
For some reason I'm having a weird thing happen to me where the combine NPCs with ar2s drop magnum ammo instead of ar2 ammo.
Sergeant Pan  [author] 17 Feb @ 11:39am 
@Ori

This addon only works on NPCs that are actively carrying a weapon, so NPCs that don't/can't carry weapons aren't supported.

However my NPC Item Drops addon can do that.
Ori 17 Feb @ 10:41am 
How do i make zombies drop ammo too?
Meen And Grean 17 Oct, 2024 @ 11:17am 
I've been looking for an addon like this for a long time that just gets rid of enemy drops. I like playing on maps that spawn lots of NPCs and I don't want their drops making my game lag, and this handles that perfectly. The only thing that's missing now is preventing them from dropping grenades, health, and batteries but other than that, it's perfect.
seabazian 22 Sep, 2024 @ 1:21pm 
thanks for this, creator
Jaden The Gundragon 7 Aug, 2024 @ 3:36am 
I just saw the update, and i was like “holy crap! I made that happen! I made a difference!”
Jaden The Gundragon 7 Aug, 2024 @ 2:00am 
oh please do, it gives your addon a borderlands kinda vibe when it plays in conjunction to the Dynamic Entity Replacer mod that you would have to download from a link in the take and hold map
Sergeant Pan  [author] 7 Aug, 2024 @ 12:40am 
@Jaden The Gundragon

That isn't a feature in the addon, but I can definitely add it in.
Jaden The Gundragon 7 Aug, 2024 @ 12:26am 
hey, can you help me figure out a way to use your addon to have npcs have a CHANCE to drop a weapon?
Sergeant Pan  [author] 6 Jan, 2024 @ 11:04pm 
@WolfOS

That means you have an addon that is replacing the default HL2 ammo entities. If you're using something like Total Replacer to replace the ammo with something else then that is the source of the issue.
M. Winters 6 Jan, 2024 @ 3:16pm 
There's a weird bug with this addon, im not sure what exact concoction causes it to occur, but anytime i kill an enemy, some random spot on the map will eject a stack of ammo, typically of every single ammo type to exist in base game Half Life 2.
Sergeant Pan  [author] 31 Dec, 2023 @ 11:40am 
@Th3TopMuglet

Any NPC with a weapon that uses base HL2 ammo should work fine. I haven't tested this with VJ Base but there shouldn't be any problems.
Th3TopMuglet 31 Dec, 2023 @ 9:58am 
does this work on VJ base npcs
Ronnie1001 16 Oct, 2023 @ 8:54am 
Yes but that applies to all combine soldiers, not just the elites.
In HL2 only elites drop the AR2 orbs
Sergeant Pan  [author] 15 Oct, 2023 @ 11:54pm 
@Ronnie1001

There's an option in Ammo Drop Settings to make only Combine Soldiers drop AR2 Orbs. It's under the "Disable AR2 Orb Drops" option.
Ronnie1001 15 Oct, 2023 @ 3:22pm 
Sorry to ask something again but could you add a config to make only elites drop ar2 orbs (Like in hl2)
Ronnie1001 14 Oct, 2023 @ 12:43am 
I see, thanks for responding, its a bit annoying but more pistol ammo never hurt I suppose :steamhappy:
Sergeant Pan  [author] 14 Oct, 2023 @ 12:40am 
@Ronnie1001

If the weapons don't have ammo types defined then there's not much I can do. There's no real way to disable it, other than disabling pistol ammo drops (which affects all weapons.) Making a whole system for weapon-specific drops is beyond my capabilities.
Ronnie1001 13 Oct, 2023 @ 11:32pm 
Npcs that have custom weapons default to dropping pistol ammo, could you disable this or possibly make it so that you can set what custom weapons drop which type of ammo?
Sergeant Pan  [author] 15 Aug, 2023 @ 10:35pm 
@Brimmla

It's the Dynamic Weapon Replacer . There's also the Simple Weapon / Item Highlights addon, however it's not the one used in the picture.
Searls 15 Aug, 2023 @ 4:16pm 
whats that mod with the identifying guns on the floor
Spywagen 18 Jun, 2023 @ 1:46pm 
custom entity doesnt seem to work, i try item_battery and it says it has a typo or doesn't exist, if i want to mke a suit battery spawn what do i type?
Jarthuzad 7 Feb, 2023 @ 9:09am 
or suit armor drops
Jarthuzad 7 Feb, 2023 @ 8:06am 
I'm sorry if you aren't taking suggestions, but an option to drop a second, random ammo type or something similar would be nice! Otherwise, probably my favorite drop on death mod.
Rōnin 24 Dec, 2022 @ 11:21am 
Ah that's why, I forgot the "Custom Entity" part from the list lol. I committed a silly. Thank you.
Sergeant Pan  [author] 24 Dec, 2022 @ 11:03am 
@Rōnin

In the dropdown menu, select "Custom Entity" (which I assume you have already done).

Write the entity name (not the name shown on the icon) without quotation marks or anything.

To get the entity name, right click the entity you want to use, press "Copy to clipboard", and paste the text you copied into the textbox.
Rōnin 24 Dec, 2022 @ 10:55am 
So how does the "custom entity" option work? I tried swapping some of the ammo drops for their large counterparts from the base game, and it won't work. They still drop regular sized ammo. Do I need to use quotations, semicolon or other variables?
Fvynchynch 27 Oct, 2022 @ 11:44pm 
[NPCs / Players drop ammo on death] lua/autorun/npcplayerammodrops.lua:77: attempt to call method 'GetActiveWeapon' (a nil value)
1. v - lua/autorun/npcplayerammodrops.lua:77
2. Run - lua/includes/modules/hook.lua:96
3. unknown - lua/entities/npc_gmodzombie.lua:181
4. FireBullets - [C]:-1
5. ProgressPhysBullet - lua/arccw/shared/sh_physbullet2.lua:404
6. v - lua/arccw/shared/sh_physbullet2.lua:238
7. unknown - lua/includes/modules/hook.lua:96

I was playing with a new addon called PlayerModel Zombies | The Beauty of Annihilation.
Colonel Kirov 22 Jul, 2022 @ 8:38pm 
[NPCs / Players drop ammo on death] lua/autorun/npcplayerammodrops.lua:297: attempt to index global 'attacker' (a nil value)
1. v - lua/autorun/npcplayerammodrops.lua:297
2. unknown - lua/includes/modules/hook.lua:96

While I suicide by typing "kill" on console, some Lua errors appeared like this.
ballsaSTEEL2001 29 May, 2022 @ 1:36am 
You are a legend Mr. Sergeant Pan hop on Team Fortress 2 with me sometime and we should streamline the community servers together. Go plow some payload maps with high population counts and just tear the game up, I appreciate you and think that you are a great guy. Thanks again for all your help I apologize for sounding like a bitch
Sergeant Pan  [author] 29 May, 2022 @ 1:34am 
@ballsaSTEEL2001

That's all I needed, I know what the problem is now. Expect a fix in a few minutes.
ballsaSTEEL2001 29 May, 2022 @ 1:29am 
Here is the three which I have gotten for some strange reason, and ya know the funny thing was? These weapons worked fine with the addon before on my other pc, worked on that pc just like a charm. I tried to ditch it to turn to Jesus, but so far it has been nothing but pain and misery and a decision I deeply regret but fuck my life fuck it I wish I was dead it'd be way better to be dead.
Way way better. But I can't change the miserable shitty fact I am alive so, here's this information you wanted.
ballsaSTEEL2001 29 May, 2022 @ 1:29am 
(A.) [NPCs / Players drop ammo on death] lua/autorun/npcplayerammodrops.lua:53: attempt to index a nil value
1. v - lua/autorun/npcplayerammodrops.lua:53
2. unknown - lua/includes/modules/hook.lua:96
3. TakeDamageInfo - [C]:-1
4. unknown - lua/weapons/tf_weapon_club.lua:15
(B.) [NPCs / Players drop ammo on death] lua/autorun/npcplayerammodrops.lua:53: attempt to index a nil value
1. v - lua/autorun/npcplayerammodrops.lua:53
2. unknown - lua/includes/modules/hook.lua:96
3. TakeDamageInfo - [C]:-1
4. unknown - lua/autorun/bsmod_killmove.lua:763
(C.) [NPCs / Players drop ammo on death] lua/autorun/npcplayerammodrops.lua:53: attempt to index a nil value
1. v - lua/autorun/npcplayerammodrops.lua:53
2. unknown - lua/includes/modules/hook.lua:96
3. FireBullets - [C]:-1
4. unknown - lua/weapons/tf_weapon_smg.lua:13
ballsaSTEEL2001 29 May, 2022 @ 1:23am 
Just one moment this may take me a while to replicate the circumstances I was in, apologies.
Sergeant Pan  [author] 29 May, 2022 @ 1:08am 
@ballsaSTEEL2001

If the addon is shooting out errors then they should be printed in the console. If you can post the error here I can look into the problem.
ballsaSTEEL2001 29 May, 2022 @ 1:03am 
@Sergeant Pan

Sure wish that I could, but all that I did on my end to apparently ruin something was have to change to a different PC. Installed the game on this one and the addon just flat doesn't work at all, no one with or without a gun wants to drop ammunition. Just make errors for the game to bitch about
I'd rather be at the mercy of the map designers for the ammo in my guns than to keep this addon who makes the top left side of my monitor ruin the immersion for me constantly because I killed something. Sorry bro, wish I knew what was wrong with it but I tried with and without all my other addons installed (As is the first thing that any wise Garry's Mod players should do when experiencing technical difficulty) but alas. I make the chad joke in my original comment
Because that is how I felt about the state of the addon, I opened the game and went 'Work, damit'
And your addon just stuck his chin out at me and said, "No."
Sergeant Pan  [author] 29 May, 2022 @ 12:58am 
@ballsaSTEEL2001

Could you be more specific? The addon works perfectly fine on my end.
ballsaSTEEL2001 29 May, 2022 @ 12:48am 
Doesn't work no more. Chad for a while. Bad for the mile.
HK-47 27 May, 2022 @ 1:57pm 
Mod isn't working for some reason on my game.. Npcs are dropping guns when I disabled that
Skrint 26 May, 2022 @ 11:14pm 
I apologise for not seeing that you’d made that, thanks a lot for showing me!
Sergeant Pan  [author] 26 May, 2022 @ 11:10pm 
@Taskmaster

My other addon already performs that exact function, and you can use it alongside this one.
Skrint 26 May, 2022 @ 8:32pm 
Love this mod so much, would you consider adding the option of health vial and medkit dropping?
HK-47 22 May, 2022 @ 4:25am 
Great mod! This is probably the best one I've seen and this one actually allows you to edit the the drop chance which is great!
Sergeant Pan  [author] 6 Apr, 2022 @ 10:40pm 
@Why do I hear boss music?

I suppose I could do something like that. It's simple enough as far as I'm concerned.
what if this, but armor
Stockphot 26 Feb, 2022 @ 5:26pm 
I'm using this mod ( https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2156004721&searchtext=vmanip+manual ) and I can't pick up the dropped ammo for some reason
wheels1390 23 Feb, 2022 @ 4:49pm 
[NPCs / Players drop ammo on death] lua/autorun/tryingtofixarccw.lua:63: attempt to call method 'SetPos' (a nil value)
1. v - lua/autorun/tryingtofixarccw.lua:63
2. unknown - lua/includes/modules/hook.lua:96
3. FireBullets - [C]:-1
4. Bullets - lua/weapons/mg_base/modules/shared/sh_primaryattack_behaviour.lua:287
5. func - lua/weapons/mg_base/init.lua:75
6. unknown - lua/includes/extensions/net.lua:33
Pirapea 21 Jan, 2022 @ 9:13am 
what is that ragdoll mod?