nanos world API Reference Unofficial documentation
Static function Shared Fast

Console.RegisterCommand

Registers a new Console Command

Syntax

Lua
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)
  • params any...
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

Registering to a command that sends a message to everyone
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" })