Garry's Mod Wiki

Revision Difference

Entity:DTVar#527446

<function name="DTVar" parent="Entity" type="classfunc"> <description> <internal></internal>⤶ <internal><br/><br/>You should use <page>Entity:NetworkVar</page> instead</internal>⤶ Sets up a self.dt.NAME alias for a Data Table variable. ⤶ <warning>You should use <page>Entity:NetworkVar</page> instead</warning>⤶ </description> <realm>Shared</realm> <args> <arg name="Type" type="string">The type of the DTVar being set up. It can be one of the following: 'Int', 'Float', 'Vector', 'Angle', 'Bool', 'Entity' or 'String'</arg> <arg name="ID" type="number">The ID of the DTVar. Can be between 0 and 3 for strings, 0 and 31 for everything else.</arg> <arg name="Name" type="string">Name by which you will refer to DTVar. It must be a valid variable name. (No spaces!)</arg> </args> </function> <example> <description>Sets up two float networked variables, **TargetZ** and **Speed**</description> <code> function ENT:SetupDataTables() self:DTVar( "Float", 0, "TargetZ" ) self:DTVar( "Float", 1, "Speed" ) end </code> </example>