Garry's Mod Wiki

Revision Difference

Global.BroadcastLua#514819

<function name="BroadcastLua" parent="Global" type="libraryfunc">⤶ <description>Sends the specified Lua code to all connected clients and executes it.</description>⤶ <realm>Server</realm>⤶ <args>⤶ <arg name="code" type="string">The code to be executed. Capped at length of 254 characters.</arg>⤶ </args>⤶ </function>⤶ ⤶ <example>⤶ <description>Print "Hello World!" in the clients' console</description>⤶ <code>BroadcastLua( <page>print( "Hello World!" )</page> )</code>⤶ <output>Hello World!</output>⤶ ⤶ </example>