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.

  • 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. Options: "text", "progressbar", or "minigame".

  • 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.

  • 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.

Client-Side Logic

If you need to execute client-side code or actions, navigate to av_laptop/client/editable/terminal.lua. Inside this file, you will find the following events:

The "external" Action

This event is triggered when an action is set to the "external" type. It allows you to integrate your own custom logic or external resources.

  • Example: If the terminal receives the command "atm-crack", you can use this event to trigger a custom ATM hacking minigame or verify if the player is currently standing in front of an ATM. The possibilities are limited only by your imagination.

The "success" Event

This event runs automatically after a command has been successfully executed. It is the client-side equivalent of the onSuccess function.

  • Parameters: You will receive the command and args variables, which you can use to trigger specific client-side effects, animations, or scripts based on the completed command.

Last updated