Garry's Mod Wiki

Entity:SetNWBool

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.

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

Special Pages


Wikis

?

Render Time: 56ms

DB GetPage 37
Generate Html 3
SaveChanges (1) 6
Render Body 0
Render Sidebar 7