NPC XP and Money

Hi,

I want to do that a zombie give me 150XP and a Fast Zombie 250XP!

Can anyone help me? Thx!

I want to give the player money and XP with this!

Sorry for my Bad english! I’m from Germany ^^



local NPCTable = 
{ 
   {"zombie", 150},
   {"fast_zombie", 250}
}

hook.Add("OnNPCKilled", "whatever", function(npc, attacker, inflictor)
  for k,v in pairs(NPCTable) do 
       if npc:GetClass() == v[1] then 
         ply:SetNWInt(v[2])
      end 
  end
end )


Testing it! thx! <3

[editline]9th August 2015[/editline]

Not working ?

[editline]9th August 2015[/editline]

GOT IT WORK THX <3