Garry's Mod

Garry's Mod

NPC Fire SMG Grenade
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
Gordon, GORDAN! 18 Oct, 2024 @ 9:38pm 
I wonder if you could make an enhancer for NPCs that makes them fire at the true rate of fire of the MP7 when they use it rather than a noticeably slower firerate they normally use?
scorb 11 Aug, 2024 @ 11:31am 
I always wondered why the combine never fired the SMG grenades, because the HECU did in the first game.
noobmaster68 30 Jul, 2024 @ 3:19am 
so cool man i'm going to give it a :steamthumbsup:
恋综男主 22 Jul, 2024 @ 5:30pm 
对轰:)
Sa-Daniels 7 Jun, 2024 @ 9:38pm 
对轰(
Stand_Up 6 Jun, 2024 @ 8:23pm 
can you add a animation that npc play before shooting the smg grenade ?
derpblue 5 Jun, 2024 @ 5:50am 
When I use custom HL2 Grenade and this together, The custom HL2 Grenade override the setting in the option tab (Basically you can't see NPC's SMG Grenade setting anymore)
Chez 4 Jun, 2024 @ 9:10pm 
Yeah, im pretty sure zbase uses different weapon, although they look much alike. The ar2 is a good example, the muzzleflash of the zbase if different from the default ar2. Thus, Zbase does NOT use default weapons. Unless they somehow do use the default smg1.
XDforeth  [author] 4 Jun, 2024 @ 8:39pm 
To correct what I said:
this addon will not work if the class of weapon that NPCs hold is not "weapon_smg1".
So something like SMG model replacement won't have any impact.
XDforeth  [author] 4 Jun, 2024 @ 7:21pm 
@Jack Morpeth

Check out his weapon and ensure that it is HL2 SMG. This addon will not work if there is any kind of replacement on HL2 SMG when NPCs hold it.
Oh, but you can edit this addon to make it work on any weapon.
Jack Lawrence Morpeth 4 Jun, 2024 @ 2:04pm 
we got a bug then HL 2 Combine from Zbase fires his SMG Grenade?