Overview
Thecommand global allows you to register custom commands that can be executed from the game client. Commands are executed with a configurable prefix (default: /).
Registering Commands
With Description
Without Description
You can omit the description parameter:Command Context
Every command callback receives a context object:Array of command arguments
The raw command string (including command name)
Send a message to the playerReturns
The message to send (supports Growtopia color codes)
true on success, false on failure.Command Management
List All Commands
Returns a table mapping command names to descriptions
Execute Commands Programmatically
The full command string (including prefix)
true if the command executed successfully.Get Command Prefix
Returns the current command prefix
Set Command Prefix
Examples
Basic Echo Command
Position Command
Item Info Command
Help Command
Teleport Command
World Info Command
Greet Command
Best Practices
See Also
World API
Access player and world data
Logger API
Log command execution
Examples
More command examples