Garry's Mod Wiki

Revision Difference

Entity:GetNW2VarProxy#547651

<function name="GetNW2VarProxy" parent="Entity" type="classfunc">⤶ <description>Returns callback function for given NWVar of this entity. ⤶ Alias of <page>Entity:GetNetworked2VarProxy</page></description>⤶ <realm>Shared</realm>⤶ <file line="552">lua/includes/extensions/entity.lua</file>⤶ <args>⤶ <arg name="key" type="any">The key of the NWVar to get callback of.</arg>⤶ </args>⤶ <rets>⤶ <ret name="" type="function">The callback of given NWVar, or nil if not found.</ret>⤶ </rets>⤶ </function>⤶ ⤶ <example>⤶ <description>Prints callback function of a NWVar called "Key" of Player 1.</description>⤶ <code>⤶ print( Entity(1):GetNW2VarProxy( "Key" ) )⤶ Entity(1):SetNW2VarProxy( "Key", print )⤶ print( Entity(1):GetNW2VarProxy( "Key" ) )⤶ </code>⤶ <output>⤶ ```⤶ nil⤶ function: builtin#25⤶ ```⤶ </output>⤶ </example>