Garry's Mod Wiki

Player:SendLua

  Player:SendLua( string script )

Description

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.

Arguments

1 string script
The script to execute, limited to 6000 bytes.

Example

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

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