onClientConsole | Multi Theft Auto: Wiki Skip to content

onClientConsole

Client-side
Server-side
Shared

This event is triggered when the local player enters text in the console. Note that, if you want to add custom console commands, it is easier to use the addCommandHandler function.

Parameters

string text
  • text: the text line that was entered.

Source

element: The source of this event is the localPlayer player element.

Code Examples

client

This example outputs any text you input into the console.

function consoleCheck(text)
outputChatBox("You entered into the console: "..text, 255, 255, 0)
end
addEventHandler("onClientConsole", localPlayer, consoleCheck)