Give NPC a name?



function ENT:OnTakeDamage(dmg)

	if( self:Health() <= 0 ) then

		self.inflictor = dmg:GetInflictor()
		gamemode.Call( "OnNPCKilled", self, dmg:GetAttacker(), self.inflictor )
	end
end


Says “playername <weaponicon> #npc_classname” when I kill it.

How to make it so that is say “playername <weaponicon> My named NPC”?

Using self:SetName(“My named NPC”) does not help at all.

Im not sure were to start but i dont think you should be doing self. anything when self is not defined i do not think.

Shouldnt it be self.Entity.Inflictor

self.Entity is depreciated, self is perfectly fine.

Most #variables have to do with **[Language.Add

http://wiki.garrysmod.com/favicon.ico](http://wiki.garrysmod.com/?title=Language.Add)**

[lua]language.Add(“npc_combine_s”, “Combine Soldier”)[/lua]
I think its something like this.

Thank you.
shared.lua



if CLIENT then
	language.Add("npc_thing", "My named NPC")
end