Garry's Mod Wiki

Entity:SetNWString

Entity:SetNWString( string key, string value )

Description

Sets a networked string value on the entity.

The value can then be accessed with Entity:GetNWString 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 string value
The value to set, up to 199 characters.

Example

Sets a networked string with a key of "Nickname" and a value of "John" on a player.

player:SetNWString( "Nickname", "John" ) print( player:GetNWString( "Nickname" ) )
Output: "John"

Page Links


Special Pages


Wikis

?

Render Time: 40ms

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