Garry's Mod Wiki

Revision Difference

Entity:GetNWVarProxy#515582

<function name="GetNWVarProxy" parent="Entity" type="classfunc">⤶ <description>Returns callback function for given NWVar of this entity.</description>⤶ <realm>Shared</realm>⤶ <file line="509">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):GetNWVarProxy( "Key" ) )⤶ Entity(1):SetNWVarProxy( "Key", print )⤶ print( Entity(1):GetNWVarProxy( "Key" ) )⤶ </code>⤶ <outputfixedwidth>Fixed width</outputfixedwidth>⤶ <output>⤶ nil⤶ function: builtin#25⤶ </output>⤶ ⤶ </example>