Combine (Or Whatever) NPC Sniper.

Yes. I know there is this:
and this:

But the snipers are impossible to kill and they have lasers coming out of their crotch. They do work decently, but are also really buggy. I tried to edit this, but theres no lua file for it and it uses a class called npc_sniper which I didn’t even know exist.

Now my request is for someone to make a sniper that uses a gun model attached to it and can shoot. It should function similarly to a vortigaunt.

Well, if you’ve played hl2, you’d know they’re not buggy at all.

  1. There’s no sniper model because you’re not supposed to see them, you just see the laser.
  2. The laser’s coming out of the crotch because you don’t see them.
  3. They’re possible to kill, with explosives or AR2 alternate fire, reason is because you were to kill them by hitting them with an rpg, or with a grenade. They didn’t want you to just shoot in the window with a pistol and pass by the chapter so fast.

The Sniper isn’t glitchy at all, what you’re asking for is a new sniper. One that has different functions.

Oh, and what you’re asking for is a completely new sniper. Perhaps they can find a way to base it off of the real sniper npc, but it seems quite difficult to script another npc. You can’t find anybody these days willing to make an snpc.

It doesn’t have animations either though. If you used jaanus’s sniper model with his permission, it might work. And this is Gmod, not HL2.

The sniper that I request shouldn’t be overly complex.

[lua]local distance = 0
local enemy_pos = 0
if self:GetEnemy() == nil then//no enemy
//print( “No Enemy!” );
if math.random(1,2) == 1 then
elseif math.random(1,4) == 1 then
self:SetSchedule(SCHED_PATROL_WALK )
elseif math.random(1,2) == 1 then
self:SetSchedule( SCHED_IDLE_WALK)
self:SetSchedule( SCHED_IDLE_STAND )
self.TakingCover = false
//print( “Enemy!” );
enemy_pos = self:GetEnemy():GetPos()
distance = self:GetPos():Distance(enemy_pos)
//distance = 4000
if distance > 16000 then//if too far away
print( “Find him!” );
self:SetSchedule(SCHED_CHASE_ENEMY)//move to enemy
elseif distance < 16000 && distance > 400 then//if in reasonable distance
if self:Health() < (self.StartHealth*0.5) then//if damaged > 50% and not in cover
self.TakingCover = true
print( “Take Cover, I’m hurt!” );
self:SetSchedule(SCHED_TAKE_COVER_FROM_ENEMY)//take cover
self.TakingCover = false
local randomsound = math.random(1,4)

			if CurTime() &gt; self.speaktime then
			self.speaktime = CurTime() + 6
			if randomsound == 1 then
      			self:EmitSound( self.attack1)
			elseif randomsound == 2 then
      			self:EmitSound( self.attack2)
			elseif randomsound == 3 then
      			self:EmitSound( self.attack3)
			elseif randomsound == 4 then
      			self:EmitSound( self.attack4)
			if haslos then //&& distance &gt; 1000 then
				if math.random(1,2) == 1 then
				self:SetSchedule(SCHED_ESTABLISH_LINE_OF_FIRE)//move to shoot enemy
				self:SetSchedule(SCHED_CHASE_ENEMY)//otherwise go to them.
			if math.random(1,80) &lt; 5 then
				self:SetSchedule(SCHED_RELOAD) //give the ILLUSION of reloading. :D

obviously not the whole thing, but changing the if distance > 4000 to 16000 doesnt make a difference?

Yeah but the current Sniper Addons use the npc_sniper class because it’s the only one there.

The combine’s not lua are they?
Well, anyways, does that lua script really work?

I haven’t posted the whole thing and I was asking why it wasn’t working, changing the distance values.

Combine + Anabelle shotgun + Restricted space = Sniper! :3:

If you want a combine sniper, aren’t snipers generally meant to be hidden, as in you can’t see them, so what’s wrong with the normal one?

Because the normal one sucks and it doesn’t have a firing stance anim. The laser doesn’t come out the right place and theres no gun model. Also, the lasers just flash around and often it doesn’t shoot.


anyways, I am making one but I cant figure out why changing the values dont work.

The other guys point is that they’re supposed to be hidden and not seen, so you’re not even supposed to see them, thus no sight of the issues with the snipers (not that there are), there shouldn’t be any problems.

there is rarely any foliage and the normal sniper only shoots you if your right in its face, not far away. It is VERY Bugged.

Flubadoo. In HL2 the sniper was a laser beam coming out of a pitchblack window homing to you flopping bullets.The only ways to get rid of the sniper was to fire a grenade or other explosive into the room the sniper was in trough the window. The snipers were never seen or encountered closely in HL2. Valve didnt care shit how they function other than that.

Well i’m just requesting an SNPC. I am trying to make one and I’ve asked a question about the engagement range and no one is responding.

Guys, stop ridiculing him for not wanting to use the default sniper NPC…this is the requests section, not a lets discuss HL2 Sniper NPC.

Now I have never made an SNPC that has combat abilities but if you are going to make this yourself or whoever is going to make this I suggest having no movement scheldules, other then that I cannot provide any help.


btw I understand expressing your opinion, but all you guys did was repeat the same thing and basically tell him that this is pointless repeatedly.

so can anyone please answer why the distance value isn’t working?
@DocDoomsday I think that schedules should work fine though.