Garry's Mod Wiki


  Player:SendLua( string script )


Executes a simple Lua string on the player.

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.
The string is limited to 254 bytes. Consider using the net library for more advanced server-client interaction.


1 string script
The script to execute.


Sends "Hello World" to the client's console.

Entity( 1 ):SendLua( "print( 'Hello World' )" )