Garry's Mod Wiki

Revision Difference

Player:SendLua#512504

<function name="SendLua" parent="Player" type="classfunc">⤶ <description>⤶ Executes a simple Lua string on the player. ⤶ ⤶ **Note:** The string is limited to 254 bytes. Consider using the [net library](/gmod/Net_Library_Usage) for more advanced server-client interaction.⤶ </description>⤶ <realm>Server</realm>⤶ <args>⤶ <arg name="script" type="string">The script to execute.</arg>⤶ </args>⤶ </function>⤶ ⤶ <example>⤶ <description>Sends "Hello World" to the client's console.</description>⤶ <code>⤶ local pl = Entity( 1 )⤶ pl:SendLua( "print( 'Hello World' )" )⤶ </code>⤶ ⤶ </example>