Static function
Fast
Console.RegisterCommand
Registers a new Console Command
Syntax
Console.RegisterCommand(command, callback, description = "", parameters = {})
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
command
|
string | — | The command |
callback
|
function | — | The callback to be called when the command is inputted
Callback signature
function(params)
|
description
optional
|
string | "" |
The command description to display in the console |
parameters
optional
|
string[] | {} |
The list of supported parameters to display in the console |
Examples
Console.RegisterCommand("hello", function(text), Console.Log("Sending a 'Hello %s' to everyone!", text), Chat.BroadcastMessage("Hello " .. text),end, "says a message to everyone", { "my_text" })