Kill: Difference between revisions
Jump to navigation
Jump to search
Risk of Confusion:Not to be confused with the identically named console command.
Code:To kill entities via code use UTIL_Remove. This will kill the entity on the subsequent tick.
To kill entities via VScript use Destroy() or Kill() to kill the entity on the subsequent tick
(Both use UTIL_Remove to remove the entity. Kill just additionally clears the entity's owner and l4d2 doesn't have Destroy) |
m (Don't confuse this with the "kill" cmd which makes your character in-game take their own life.) |
||
Line 1: | Line 1: | ||
{{TabsBar}} | {{TabsBar}} | ||
{{stub}} | {{stub}}{{Confusion|Not to be confused with the identically named console command.}} | ||
{{code|Kill}} is an input that removes the named entity from play, and deletes its associated [[edict]]. | {{code|Kill}} is an input that removes the named entity from play, and deletes its associated [[edict]]. | ||
An entity's [[children]] can be killed in the same [[ | An entity's [[children]] can be killed in the same [[Source Multiplayer Networking#Basic networking|tick]] by sending the {{code|KillHierarchy}} input instead, otherwise they will be killed on a subsequent tick. | ||
{{Codenote|To kill entities via code use {{ent|UTIL_Remove}}. This will kill the entity on the subsequent tick.<br>To kill entities via [[VScript]] use [https://github.com/ValveSoftware/source-sdk-2013/blob/a62efecf624923d3bacc67b8ee4b7f8a9855abfd/src/game/server/baseentity.h#L1270 Destroy()] or [https://github.com/ValveSoftware/source-sdk-2013/blob/a62efecf624923d3bacc67b8ee4b7f8a9855abfd/src/game/server/baseentity.cpp#L4582 Kill()] to kill the entity on the subsequent tick}} | {{Codenote|To kill entities via code use {{ent|UTIL_Remove}}. This will kill the entity on the subsequent tick.<br>To kill entities via [[VScript]] use [https://github.com/ValveSoftware/source-sdk-2013/blob/a62efecf624923d3bacc67b8ee4b7f8a9855abfd/src/game/server/baseentity.h#L1270 Destroy()] or [https://github.com/ValveSoftware/source-sdk-2013/blob/a62efecf624923d3bacc67b8ee4b7f8a9855abfd/src/game/server/baseentity.cpp#L4582 Kill()] to kill the entity on the subsequent tick}} |
Revision as of 13:38, 6 April 2025

Kill is an input that removes the named entity from play, and deletes its associated edict. An entity's children can be killed in the same tick by sending the KillHierarchy input instead, otherwise they will be killed on a subsequent tick.

To kill entities via VScript use Destroy() or Kill() to kill the entity on the subsequent tick