Garry's Mod Wiki

Entity:SetNWFloat

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.

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

Page Links


Special Pages


Wikis

?

Render Time: 33ms

DB GetPage 3
Generate Html 8
SaveChanges (1) 9
Render Body 0
Render Sidebar 11