ENT.EndTouch

From GMod Wiki

Revision as of 08:15, 11 October 2010 by Jcw87 (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Event Hook
Hook NameEndTouch
SyntaxENT:EndTouch( Entity ent )
DescriptionCalled when another entity ceases being in contact with the SENT.
ReturnsNil
Lua StateNewerServer.png
BBCode[b][url=wiki.garrysmod.com/?title=ENT.EndTouch]ENT.EndTouch [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionPrints a message to the player and kills the entity in a comical way.
Used onNewerServer.png
Code
function ENT:EndTouch( ent )
	if ( ent:IsValid() and ent:IsPlayer() ) then
		ent:PrintMessage( HUD_PRINTCENTER, "Noo! Don't leave me! GOODBYE CRUEL WORLD!" )
		self:Remove()
	end
end
OutputN/A


See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox