Garry's Mod Wiki

Garry's Mod Wiki

  Entity:SetNWFloat( string key, number value )

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.

There's a 4095 slots Network limit. If you need more, consider using the net library or Entity:SetNW2Float. You should also consider the fact that you have way too many variables. You can learn more about this limit here: Networking_Usage
Running this function clientside will only set it for the client it is called on.

Arguments

1 string key
The key to associate the value with
2 number value
The value to set

Example

This will set the networked float 'money' on all clients to 10.5.

for k, v in ipairs( player.GetAll() ) do v:SetNWFloat( 'money', 10.5 ) end

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated four times a day. Edits and history are not available.

Last Parsed: Loading...