Entity/SetNWFloat

From Garry's Mod
Jump to: navigation, search
 Entity:SetNWFloat( )

Contents

Description

Sets a networked float (number) value on the entity.

The value can then be accessed with Entity:GetNWFloat both from client and server.

Unlike Entity:SetNWInt, floats don't have to be whole numbers.

NOTE

Running this function clientside will only set it for the client it is called on.

Arguments

string key

The key to associate the value with

Arguments

number value

The value to set

Examples

Example

This will set the networked float 'test' on all clients to 0.5.

for k,v in pairs( player.GetAll() ) do
    v:SetNWFloat( 'test', 0.5 )
end


Personal tools
Navigation