Garry's Mod

Garry's Mod

93 ratings
NPC Fire SMG Grenade
   
Award
Favorite
Favorited
Unfavorite
Content Type: Addon
Addon Type: Effects
Addon Tags: Fun, Realism
File Size
Posted
Updated
7.686 KB
4 Jun, 2024 @ 7:28am
5 Jun @ 1:59am
11 Change Notes ( view )

Subscribe to download
NPC Fire SMG Grenade

Description
ONLY WORKS ON HL2 SMG
ONLY WORKS ON HL2 SMG
ONLY WORKS ON HL2 SMG



In brief, this addon enables NPCs with HL2 SMG to fire SMG grenades.
But they do not actually "fire" SMG grenades. It's more of a workaround or a little trick.
Anyway, it works.

I think this addon seems not to be possible to conflict with any addon about NPC`s AI.
Theoretically, it should work on every kind of NPC that can use HL2 SMG to open fire.
HL2 SMG means the weapon class is "weapon_smg1".



If you want this addon to work on other weapons, edit it ON YOUR OWN.
Tell me if any bug or lua error.
21 Comments
BranShinoobi 6 Jun @ 1:49am 
I wish NPCs can also fire Pulse-Rifle AR2 Energy Ball
♩ṳṧт Պ✺ℵ!кᾰ 5 Jun @ 3:53am 
感谢作者:steamthumbsup:
XDforeth  [author] 5 Jun @ 2:08am 
@♩ṳṧт Պ✺ℵ!кᾰ
我更新了一下代码结构,方便你自己改。

1、找到名为AllowedWeapons的表,这里面是该mod允许生效的武器。它长这样:
local AllowedWeapons = {
["weapon_smg1"] = true
}

2、比如你想加一个武器,它的类名(不是武器名)是weapon_ar2,那就将其添加到AllowedWeapons表里面去。也就是改成下面这样:
local AllowedWeapons = {
["weapon_smg1"] = true,
["weapon_ar2"] = true
}
注意逗号之类的别写掉了,你可以参考前面的代码中的那个AllowedNPCs表是怎么写的。
♩ṳṧт Պ✺ℵ!кᾰ 4 Jun @ 11:28pm 
如果我想要给多个不同的武器添加npc发射榴弹功能,是不是只要在lua里面的smg1这个武器后面加上逗号再加上其他武器就可以了
XDforeth  [author] 18 May @ 8:14pm 
@IM HIM

After reading the lua code of that combine AI mod, I'm sure it has a different way to shoot SMG grenades, compared with my mod.
They are actually doing the same thing as you can see, but they will not really interfere in each other.
IM HIM 18 May @ 12:46pm 
@Overwatch i believe it doesnt work with that ai mod because it already has it built in
Overwatch 1 Jan @ 7:21am 
SMG grenades does not work when there is combine AI mod. Do you have a chance to fix this?

https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2807525115&searchtext=combine+ai
brandonewing25 23 Nov, 2024 @ 8:14pm 
thx
XDforeth  [author] 23 Nov, 2024 @ 6:53pm 
@brandonewing25
I will do that if I have time
brandonewing25 23 Nov, 2024 @ 9:37am 
can you add a toggle for rebels to shoot smg grenades
so we can have combine or rebels shooting or both can shoot smg grenades
plz and thx