Entity/SetNWBool

From Garry's Mod
Jump to: navigation, search
 Entity:SetNWBool( )

Contents

Description

Sets a networked boolean value on the entity.

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

NOTE

Running this function clientside will only set it for the client it is called on.

Arguments

string key

The key to associate the value with

Arguments

boolean value

The value to set

Examples

Example

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

player:SetNWBool( "VIP", true )
print( player:GetNWBool( "VIP" ) )

Output:

true
Personal tools
Navigation