A weapon that deals more damage against one npc, less damage against others?

Howdy folks!

I’d like to know whether its possible or not to create a gun that deals more damage against, say, antlions, but less damage on combine.
If so, how can I achieve such an effect?

You should use that hook

That will allow you go grab information and you could do something like

[lua]
local function ChangeDamage( ent, dmginfo )
local att = dmginfo:GetAttacker()
if IsValid( ent ) and IsValid( att ) and att:IsPlayer() then
if att:GetActiveWeapon():GetClass() == “YOUR WEAPON” and ent:GetClass() == “npc_antlion” then
dmginfo:ScaleDamage( 2 )
– doubles damage given to the antlion
end
end
end
hook.Add( “EntityTakeDamage”, “ChangeDamage”, ChangeDamage )
[/lua]
P.s. Thanks randomscript for this ;D