Guide 1 Docs 2 Reference 3

Function of Commands

commands.add

usage: "bet <amount:integer 1..10000> [color:red|black]". Types: word, integer, number (with an optional min..max), player, a|b|c, text... (the rest of the line as a string), words... (as a list). args holds each argument by name; an optional one not typed is nil. Return a string and the player reads it in red.

commands.add(usage: string, fn: (player: Player, args: { [string]: any }) -> string?, opts: CommandOpts?) → Command

Parameters

usagestringrequired
fn(player: Player, args: { [string]: any }) -> stringoptional
optsCommandOptsoptional

Returns

Command

Used in