Garry's Mod

Garry's Mod

545 ratings
NPC Weapon Switching
4
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: NPC
Addon Tags: Fun, Realism
File Size
Posted
Updated
29.194 KB
1 Sep @ 5:02am
4 Sep @ 1:33am
5 Change Notes ( view )

Subscribe to download
NPC Weapon Switching

In 3 collections by Lynch
Lynch Addons [GMOD]
9 items
Map Sweepers - Lynch's collection
108 items
Half-Life² Realism - Lynch's Collection
167 items
Description
[ko-fi.com]

Please take a moment to read the full description before subscribing or commenting. Thank you for your understanding.
Kind reminder to all users: spam, irrelevant messages, or copy-paste comments will result in immediate blocking. This notice serves as your only warning.

THIS ADDON DOES NOT ADD ANIMATIONS TO NPCS, YOU REQUIRE OTHER ADDONS FOR THAT

WORKS AND IS RECOMMENDED WITH: MAP SWEEPERS

BEST PAIRED WITH: Lynch’s NPCs Item Drops, Lynch’s NPCs Essentials

ABOUT:
One of the standout features from Lynch's NPCs Essentials was so unique that I couldn’t just leave it as “one more feature” in a larger addon. Instead, I decided to split it into its own dedicated addon, while also improving the codebase and adding new customization options.

This addon gives NPCs (currently npc_combine_s and npc_citizen) the ability to seamlessly switch between their primary and secondary weapons, just like in COD or Trepang2.

KEY FEATURES:
  • Optimized codebase for performance and stability.
  • Unique decision-making logic that allows NPCs to choose when to switch weapons.
    • NPCs can decide whether to swap weapons when they’re out of ammo or about to run out.
  • Configurable options:
    • Set a global secondary weapon for all supported NPCs.
    • Or enable a ConVar that lets NPCs spawn with a random secondary weapon chosen from a hardcoded pool.
  • Misc ConVars:
    • Adjust the reload animation speed when NPCs switch weapons.
    • Force NPCs to reload upon first spawn during their setup phase.
  • Visual holsters (configurable):
    • Support for sidearm holsters (handgun-type weapons).
    • Holsters for whichever weapon (primary or secondary) is not currently in use.
  • When an NPC using this system dies, it will drop both its primary and secondary weapons.
  • Should be fully compatible with most addons that alter NPC AI or behavior.

KNOW ISSUES:
  • When using HL2 weapon replacements or completely new NPC weapons, holstered angles may look odd. Sadly, the only solution would be writing per-weapon angle fixes, which I will only do if there are enough requests for the same broken weapon model.
  • On the x64 branch of Garry’s Mod, this addon works correctly. However, animation addons for Combine Soldiers (to allow them to use handguns) are broken on that branch. The most noticeable issue is that when standing still and firing a handgun, the Combine Soldier may adopt the SMG1 holding animation after every shot. This is not caused by my addon nor the animation authors, it’s simply an incompatibility with the x64 branch. I recommend using this addon on the default branch of Garry’s Mod. - Added a convar to fix that
  • Incompatible with "Automatic Culling - Dynamic auto-cull" by Vuthakral, and potentially with other addons that behave similarly. The issue is strange but reproducible: the NPC’s secondary weapon gets duplicated in-hand, creating a hybrid between the primary and secondary weapon models.

SPECIAL COMPATIBILITY WITH:
NPC Flashlights System - Compatibility would not have been possible without the help of the original creator, this addon works fine with his!

RECOMMENDED ADDONS
For the best experience, I highly recommend using these alongside this addon:
These addons fix or improve the animations for Citizens and Combine Soldiers, and also give Combine Soldiers the ability to properly use sidearms and melee weapons.

Enjoy.

⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀    Did you like the add-on? Show support by giving it a thumbs up!


TAGS Realism, NPC, Weapon, Entity, Effect, Call Of Duty, Modern Warfare, Realistic, QoL, Quality of Life, Trepang2, TP2, COD, Weapon Change

Copyright © 2025-20XX by Lynch, All rights reserved.
No part of this content, including files or code, may be reproduced, copied, adapted, merged, or modified without prior written consent from the original author, Lynch.
Unauthorized use or reproduction of this content may violate Valve's Terms and Conditions and Steam Workshop Rules Official Garry's Mod Wiki[wiki.garrysmod.com].

Any violation of this copyright notice will result in a formal DMCA complaint and report to Steam Support. That said, if you’d like to use any of my code legitimately, feel free to contact me and we can discuss it.
Popular Discussions View All (2)
2
5 hours ago
PINNED: how about send your suggestions here? gentlemen
XX360HATMASTERXX
1
20 hours ago
PINNED: how about send your bug/glitch report here? gentlemen
XX360HATMASTERXX
83 Comments
killboss 1 hour ago 
good!
:steamthumbsup:
Potato PC[TW] 5 hours ago 
Is it possible to make it compatible with [Simple Weapons: Base]?
Stray Cat Strut 6 hours ago 
This comment is awaiting analysis by our automated content check system. It will be temporarily hidden until we verify that it does not contain harmful content (e.g. links to websites that attempt to steal information).
UnShu 13 hours ago 
Could you make a mod for this but as replacement models for hl2 and the same gmod in general?
Bnjamnr0y 17 hours ago 
It works fine, but once the combine switches to the secondary and runs out of ammo, they dont know how to shoot with they normal guns again
<<Mr. (ant) tenna>> 19 hours ago 
you should code some kinda keyvalue for the npcs
Lynch  [author] 21 hours ago 
@goblinlaptop This uses LUA, half life don't, it's impossible to add it to half life
Lynch  [author] 21 hours ago 
@gutripper Disable reloading on spawn, will find a way to fix it later.
goblinlaptop 21 hours ago 
pls ad to half life
gridstream 5 Sep @ 1:46am 
can I get the same mod but only for players?