Docs/API

Chat commands

Register scenario chat commands and handle player and args parameters, command names, built-in conflicts and permissions.

API version 1Lua 5.1Updated 2026-11-07

command(name, function(player, args))#

Adds the chat command /name.

  • name is 1 to 32 lowercase letters, digits or _. A leading / is ignored. Registering the same name again replaces the earlier function.
  • Built-in chat commands (menu, players, help, mute, unmute, unban, tp, tpcoords, tparea, items, noclip, god, occlusion, scenario) cannot be replaced; using one of their names raises an error.
  • args is the list of words typed after the command, split on spaces (quotes are not special). /pay Bo 50 gives {"Bo", "50"}.
  • The usual chat rules apply first: the player must be fully in the world, muted players cannot use commands, and the chat rate limit counts.
  • Every player sees scenario commands in /help, so check player.admin yourself for admin-only commands.
  • The function runs immediately and may wait.

Found a mistake or missing detail? Tell us in the Discord.