Garry's Mod Wiki


  net.WriteString( string string )


Appends a string to the current net message. The size of the string is 8 bits plus 8 bits for every ASCII character in the string. The maximum allowed length of a single written string is 65532 characters.


1 string string
The string to be sent.


Sends a message to all the clients.

-- Server util.AddNetworkString( "SendMessage" ) net.Start( "SendMessage" ) net.WriteString( "Hello World!" ) net.Broadcast() -- Client net.Receive( "SendMessage", function( len ) local message = net.ReadString() chat.AddText( color_white, message ) end )