Killing an SNPC and getting money

Hi. I was wondering what the script would be if you kill a SNPC. Not NPC. SNPC

I know that for player death it would be
[LUA]
function playerDies( victim, weapon, killer )

killer:GiveMoney(100)

end

hook.Add( “PlayerDeath”, “playerDeathTest”, playerDies )
[LUA]

And for NPC it would be

[LUA]
function GM:OnNPCKilled( victim, killer, weapon )

     killer:GiveMoney(120)

end
[LUA]

but what would it be for SNPC?
I really would like a script thank you!

P.S : GiveMoney was defined in the meta.lua

GM:OnNPCKilled() works for SNPCs too

Nope I tried with Dans homemade SNPC pack and it didn’t give me any cash

Well they are based off of the NPC’s from HL2, so I don’t see why it’s not calling that hook when they die. Are you sure you’ve put in the right code? Try doing

[lua]function GM:OnNPCKilled( victim, killer, weapon )

if killer:IsValid() && killer:IsPlayer() then

killer:GiveMoney(120)

end

end[/lua]

[editline]07:34AM[/editline]

Also, are you using the money system off of the GMod Wiki Tutorial?

No. But the meta is there. GiveMoney