Kill: Difference between revisions
Jump to navigation
Jump to search
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() to kill the entity on the subsequent tick, or Kill() to kill it immediately (not recommended).
SirYodaJedi (talk | contribs) No edit summary |
SirYodaJedi (talk | contribs) No edit summary |
||
Line 4: | Line 4: | ||
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. | 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 {{ent|Destroy()}} to kill the entity on the subsequent tick, or {{ent|Kill()}} to kill it immediately.}} | {{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 {{ent|Destroy()}} to kill the entity on the subsequent tick, or {{ent|Kill()}} to kill it immediately (not recommended).}} | ||
== See also == | == See also == |
Revision as of 12:45, 17 March 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() to kill the entity on the subsequent tick, or Kill() to kill it immediately (not recommended).