Garry's Mod Wiki

BroadcastLua

BroadcastLua

  BroadcastLua( string code )

Description

Sends the specified Lua code to all connected clients and executes it.

If you need to use this function more than once consider using net library. Send net message and make the entire code you want to execute in net.Receive on client.

Arguments

1 string code
The code to be executed. Capped at length of 254 characters.

Example

Print "Hello World!" in the clients' console

BroadcastLua( "print( 'Hello World!' )" )
Output: Hello World!

Special Pages


Wikis

?

Render Time: 19ms

DB GetPage 2
Generate Html 3
SaveChanges (1) 5
Render Body 0
Render Sidebar 7