Terminal

circle-info

Included commands are for demonstration purposes only.

Designed to mimic the look and feel of a traditional terminal, this app provides an intuitive and powerful tool for executing various commands.

Register Commands

  • Navigate to av_laptop/server/editable/_terminal.lua

  • Add your custom commands to the allCommands table using the following structure:

Base Properties

  • index key:string The command trigger. This must be unique.

  • show:boolean Displays the command when command help is used.

  • args?:string Defines the required parameters for the command. All parameters are combined into a single string, with each one enclosed in angle brackets (< >)

  • allowed: function(playerId, laptopSerial) Returns true or false. Determines if the player is permitted to see and use the command. If false, the command will be hidden from the /help list.

  • canProcess: function(playerId, laptopSerial, args) Verifies that the user meets the requirements to execute the command (e.g., special permissions, specific items, or required arguments).

  • onSuccess: function(playerId, laptopSerial, args) This function runs only if canProcess returns true. Use this to execute any custom server-side logic.

  • actions:table[] A sequence of actions executed by the terminal in descending order. Each action supports the following properties:

Action Properties

  • type:string The action to perform.

    • Available options: "text", "progressbar", "minigame" "external" "userInput" "table"

  • input?:string The content to be processed (e.g., the text to display or the name of the minigame to trigger). List of available minigames can be found in the Minigames section.

  • delay:number The duration (in milliseconds) to wait before executing the next action in the sequence.

  • style:string Optional. Used with the "text" type to apply an "error" or "output" visual style.

  • callback?:string Callback to trigger after action gets completed, this callback should be already registered client side, you can find an example here: Exports

  • output:table[] The final message rendered once all actions and minigames have been successfully completed.

    • message (string): The text content to display.

    • color (string): The HEX or CSS color for the text.

Table

The table action renders a structured data grid directly within the terminal output. It is highly useful for displaying organized lists, such as nearby networks, vehicle data, or directory contents.

Properties:

  • type (string): Must be exactly "table".

  • columns (array): An array of strings defining the header titles.

  • rows (array): A multi-dimensional array containing the row data. The data order must match the defined columns.

  • delay (number): The pause duration in milliseconds after rendering the table before executing the next action.

You can find a demo script using Tables in Keyfob Example

Last updated