Permalink
Browse files

Nextbot example of how you'd fire OnNPCKilled

  • Loading branch information...
1 parent 39638ba commit 89fc66d89e24f439dfe54a640335cbb9d600414d @robotboy655 robotboy655 committed Jun 5, 2015
Showing with 2 additions and 0 deletions.
  1. +2 −0 garrysmod/gamemodes/base/entities/entities/base_nextbot/sv_nextbot.lua
@@ -124,6 +124,8 @@ end
--
function ENT:OnKilled( damageinfo )
+ hook.Run( "OnNPCKilled", self, dmginfo:GetAttacker(), dmginfo:GetInflictor() )
+
self:BecomeRagdoll( damageinfo )
end

3 comments on commit 89fc66d

@shadowmaruz

I'd probably check to see if ENT:IsNPC() first though, even though it doesnt matter to most lol

@bmwalters
Contributor

dmginfo ~= damageinfo
(#981)

@shadowmaruz

LOL I just saw that too lol

Please sign in to comment.