Is it possible to change language.add name in this case? if so how?

I’ve made a poison zombie torso but the problem is when you kill it or it kills you it says “Poison Zombie” not “Poison Zombie Torso” and I don’t know how to fix this in this case?

Here’s my code



local nextName
local tbNPCs = {}
hook.Add("PlayerSpawnNPC","npc_poisonzombie_torso_spawn",function(pl,name,wepName) nextName = name end)

hook.Add("PlayerSpawnedNPC","npc_poisonzombie_torso_model",function(pl,npc)
	if(!nextName) then return end
	if(tbNPCs[nextName]) then npc:SetModel(tbNPCs[nextName]) end
	nextName = nil
end)

local function AddNPC(category,name,class,model,keyvalues,skin)
	list.Set("NPC","npc_poisonzombie_torso",{Name = name,Class = class,Skin = skin,Model = model,Category = category,KeyValues = keyvalues})
	tbNPCs["npc_poisonzombie_torso"] = model
end

AddNPC("Zombies + Enemy Aliens","Poison Zombie Torso","npc_poisonzombie","models/zombie/poison_torso.mdl",{["crabcount"] = 3},4)

hook.Add( "OnEntityCreated", "npc_poisonzombie_torso_fx", function( ent )
if ent:IsNPC() then
timer.Simple( 0, function() if ent:IsValid() and ent:GetClass() == "npc_poisonzombie" and ent:GetModel() == "models/zombie/poison_torso.mdl" then ent:SetSkin(3) ent:SetCollisionBounds(Vector(-4,-4,0), Vector(4,4,27)) ent:SetSequence(1) ent:SetName("Poison Zombie Torso") end end )
end
end)

hook.Add("OnNPCKilled", "npc_poisonzombie_torso_death", function(victim, Inflictor, killer)

        if victim:GetName() == "Poison Zombie Torso" then

                victim:SetModel("models/zombie/poison_torso.mdl")
                victim:SetSkin(4)
end
end)


I’ve tried putting language.Add(“Poison Zombie Torso”) in the OnEntityCreated part but it doesn’t work

try it like this:


language.Add("Poison Zombie", "Poison Zombie Torso")

Doesn’t work… Is there a way to give it it’s own classname “npc_poisonzombie_torso” with the code I have? Then I could do it

Whatever the file name is, the name will be. So you have obviously named the file “Poison Zombie” instead of “npc_poisonzombie_torso”.

Haha no… it’s always been npc_poisonzombie_torso… it isn’t a actual new entity class just edits poison zombies model and collision bounds as a new npc

Any help? Or for making it a separate class a as npc_poisonzombie_torso with the same function it has to be a changed model version of poison zombie

?

?


(User was banned for this post ("Don't bump threads without content. Doing this won't make people answer you faster" - OvB))

Right now it just uses poison zombies class so that’s why I can’t change the language name

And why was I rated dumb?

3 bumps in 1 day is enough to kill grandma as they say

As for the problem, if language.Add doesn’t fix it, I don’t know what will