Coming soon toSteam
Modding docsAPI 1

Module · Developer tools

devtools

Add commands to the developer console (F1). Needs the "devtools" permission.

devtools.command(options: table, run: function): string

Adds a console command and returns the route to type. options: name (letters, digits, '-', '_'), description, level ("client", "admin" or "host"; default "client"). run(args) receives the words typed after the command as strings.

  • options: { name = string, description = string?, level = "client"|"admin"|"host"? }

Returns the route, e.g. "/rings.spawn"

-- mod id "community.rings"  →  typed as /rings.spawn 12
devtools.command({ name = "spawn", description = "Ring of spheres", level = "admin" }, function(args)
  spawnRing(tonumber(args[1]) or 8)
end)