Entity/GetClass

From Garry's Mod
(Difference between revisions)
Jump to: navigation, search
m (Little definition on what a class is)
 
Line 2: Line 2:
 
|Name=GetClass
 
|Name=GetClass
 
|Parent=Entity
 
|Parent=Entity
|Description=Returns the classname of a entity.
+
|Description=Returns the classname of a entity. This is often the name of the Lua file or folder containing the files for the entity
 
|Realm=Shared
 
|Realm=Shared
 
|IsClass=Yes
 
|IsClass=Yes

Latest revision as of 23:07, 1 April 2015

 Entity:GetClass( )

Contents

Description

Returns the classname of a entity. This is often the name of the Lua file or folder containing the files for the entity

Returns

string

The entity's classname

Examples

Example

Prints the classname of the weapon that the player is holding.

print( LocalPlayer( ):GetActiveWeapon( ):GetClass( ) )

Output:

Prints the classname of the weapon that the player is holding. (ie weapon_crowbar)
Personal tools
Navigation