Entity.GetTable

From GMod Wiki

Jump to: navigation, search
Function
Syntax Entity:GetTable( )
Description:
Retrieves the entity's table set with Entity:SetTable. In the case of scripted entities, this retrieves the 'ENT' table which holds all of the scripted entity's methods and what-not.
Returns: Table
In Object: Entity
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Entity.GetTable]Entity.GetTable [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionStores the table values associated with fields 'Ent1' and 'Ent2' in the constraint entity 'self.Constraint' into ent1 and ent2, and then returns their value to the console (constraint.Entity's first two arguments are stored into the table fields Ent1 and Ent2, respectively).
Used onNewerServer.png
Code
 
self.Constraint = constraint.Ballsocket(wire_servo, trace.Entity, 0, trace.PhysicsBone, Vector(0,0,0), 0, 0, 0)
 
local ent1 = self.Constraint:GetTable().Ent1
local ent2 = self.Constraint:GetTable().Ent2
 
Msg( ent1.." and "..ent2 )
 
Output[Entity [54][gmod_wire_servo4]] and [Entity [52][prop_physics]]


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox