hook( id, table, func, arg )

instance function

Hook on to the chat input - when the player types something and presses enter to send the chat, your callback will be called so you can process it if required.

Arguments

Name Type Description
id String Unique id for the hook
object Table If the callback is an instance function, a table. Can be nil.
func Function The callback function to call.
arg Any An argument to pass to the hook function

Returns

Type Description
Boolean True if the hook was added

Notes

The callback function should have the following signature - text is the string that the player entered, supplied by the TextInput library and hook is a TextInputHook object.

function ExampleTable:exampleFunction( text, hook )