ENT.Touch
From GMod Wiki
Event Hook | |
Hook Name | Touch |
Syntax | ENT:Touch( Entity ent ) |
Description | Called when another entity comes into contact with the entity. |
Returns | Nil |
Lua State | |
BBCode | [b][url=wiki.garrysmod.com/?title=ENT.Touch]ENT.Touch [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
Description | When a player touches the ent, the player is killed. |
---|---|
Used on | |
Code | function ENT:Touch( hitEnt ) if ( hitEnt:IsValid() and hitEnt:IsPlayer() ) then hitEnt:Kill() end end |
Output | N/A |