ENT.Touch

From GMod Wiki

Jump to: navigation, search
Event Hook
Hook NameTouch
SyntaxENT:Touch( Entity ent )
DescriptionCalled when another entity comes into contact with the entity.
ReturnsNil
Lua StateNewerServer.png
BBCode[b][url=wiki.garrysmod.com/?title=ENT.Touch]ENT.Touch [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionWhen a player touches the ent, the player is killed.
Used onNewerServer.png
Code
 function ENT:Touch( hitEnt )
 	if ( hitEnt:IsValid() and hitEnt:IsPlayer() ) then
 		hitEnt:Kill()
	end
 end
OutputN/A


See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox