Entity/Use

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
(Page described the hook variant of the use function, rather than the regular class function.)
Line 1: Line 1:
 
{{Func
 
{{Func
 +
|Description=Activates the entity, as if a player pressed 'E' on it.
 +
|Realm=Server
 +
|IsClass=Yes
 
|Name=Use
 
|Name=Use
 
|Parent=Entity
 
|Parent=Entity
|Description=Called when an entity is used. (Default, 'E' is pressed)
 
|Realm=Server
 
|IsClass=Yes
 
 
}}
 
}}
 
{{Arg
 
{{Arg
 
|type=Player
 
|type=Player
 
|name=User
 
|name=User
|desc=The player that used the entity.
+
|desc=The player to credit with activating the entity.
}}
+
{{Example
+
|Description=Removes itself when used.
+
|Code=function ENT:Use(ply)
+
self.Entity:Remove();
+
end;
+
 
}}
 
}}

Revision as of 06:00, 11 December 2015

 Entity:Use( )

Description

Activates the entity, as if a player pressed 'E' on it.

Arguments

Player User

The player to credit with activating the entity.
Personal tools
Navigation