Garry's Mod Wiki

type

string type( any var )

Description

Returns a string representing the name of the type of the passed object.

Arguments

1 any var
The object to get the type of.

Returns

1 string
The name of the object's type.

Example

Print the name of a few types.

print( type( 2 ) ) print( type( "hai" ) ) print( type( {} ) )
Output:
number string table

Example

Returns no value if called with 0 arguments/parameters.

print( type() )
Output: no value

Example

A list of code showing how you can use the type function in replacement with any of the is* functions. (example being istable, isentity, etc.)

print( type( LocalPlayer() ) ) print( type( Vector() ) ) print( type( Angle() ) ) print( type( Entity( num ) ) ) -- num is the EntIndex for the entity print( type( vgui.Create( "DFrame" ) ) )
Output:
Player Vector Angle Entity Panel

Page Links


Special Pages


Wikis

?

Render Time: 36ms

DB GetPage 4
Generate Html 9
SaveChanges (1) 9
Render Body 0
Render Sidebar 12