Garry's Mod Wiki

Revision Difference

Entity:SetNWFloat#514498

<function name="SetNWFloat" parent="Entity" type="classfunc">⤶ <description>⤶ Sets a networked float (number) value on the entity.⤶ ⤶ The value can then be accessed with <page>Entity:GetNWFloat</page> both from client and server.⤶ ⤶ Unlike <page>Entity:SetNWInt</page>, floats don't have to be whole numbers.⤶ ⤶ <note>Running this function clientside will only set it for the client it is called on.</note>⤶ </description>⤶ <realm>Shared</realm>⤶ <args>⤶ <arg name="key" type="string">The key to associate the value with</arg>⤶ <arg name="value" type="number">The value to set</arg>⤶ </args>⤶ </function>⤶ ⤶ <example>⤶ <description>This will set the networked float 'test' on all clients to 0.5.</description>⤶ <code>⤶ for k,v in pairs( player.GetAll() ) do⤶ v:SetNWFloat( 'test', 0.5 )⤶ end⤶ </code>⤶ ⤶ </example>