Garry's Mod Wiki

Entity:SetNWInt

  Entity:SetNWInt( string key, number value )

Description

Sets a networked integer (whole number) value on the entity.

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

See Entity:SetNWFloat for numbers that aren't integers.

There's a 4095 slots Network limit. If you need more, consider using the net library or Entity:SetNW2Int. 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.
This function will not round decimal values as it actually networks a float internally.

Issue Tracker: 3374

Arguments

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

Example

This will set the networked integer 'money' on all clients to 100.

for i, ply in ipairs( player.GetAll() ) do ply:SetNWInt( 'money', 100 ) end