ENT.Touch

From GMod Wiki

Revision as of 15:05, 15 May 2010 by Julio Gee (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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