Npc kill: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
{{Console Command|AI Commands}}
{{Console command|AI commands}}
The <code>npc_kill</code> console command is a debugging tool that kills NPCs. The command kills NPCs by dealing enough damage to kill them, so the "OnDamaged" and "OnDeath" outputs will be fired.  
The <code>npc_kill</code> console command is a debugging tool that kills NPCs. The command kills NPCs by dealing enough damage to kill them, so the "OnDamaged" and "OnDeath" outputs will be fired.  



Revision as of 15:22, 12 July 2023

Template:Console command The npc_kill console command is a debugging tool that kills NPCs. The command kills NPCs by dealing enough damage to kill them, so the "OnDamaged" and "OnDeath" outputs will be fired.

This command flags the NPC with a note to kill itself, so if AI is not running (due to the ai_disable command), the command will be ignored.

Usage

  • npc_kill
    • This will kill the NPC under your crosshair, if any.
  • npc_kill <entity index>
    • This will kill the NPC matching the specified entity index, if any.
  • npc_kill <name>
    • This will kill all NPCs whose classnames match the specified name, or whose targetnames match the specified name.


See also