Garry's Mod Wiki

Revision Difference

Player:SendLua#517549

<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. **Note:** The string is limited to 254 bytes. Consider using the <page text="net library">Net_Library_Usage</page> 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>