Garry's Mod Wiki

Entity:SetNWBool

  Entity:SetNWBool( string key, boolean value )

Description

Sets a networked boolean value on the entity.

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

There's a 4096 slots Network limit. If you need more, consider using the net library or Entity:SetNW2Bool. 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 boolean value
The value to set

Example

Sets a networked boolean with a key of VIP and a value of true on a player.

print( Entity(1):GetNWBool( "VIP", false ) ) Entity(1):SetNWBool( "VIP", true ) print( Entity(1):GetNWBool( "VIP" ) )
Output:
false true