# Events

{% tabs %}
{% tab title="Client" %}

#### av\_laptop:terminal

> Triggers terminal actions from the client side. Similar to a terminal export, with the added capability of being triggered remotely by server events.
>
> **params:**
>
> * **actions**:`table` A table with actions, most follow the [Terminal](/laptop-pack-v3/laptop-v3/terminal.md#action-properties)format.
>
> <pre class="language-lua" data-title="server.lua"><code class="lang-lua">-- Triggered from server side
> local playerMoney = exports['av_laptop']:getMoney(source, "bank") or 0
> <strong>local actions = {
> </strong>    {
>         type = "text",
>         input = "You current bank funds are: $"..playerMoney,
>         delay = 600
>     },
> }
> TriggerClientEvent("av_laptop:terminal", source, actions)
> </code></pre>

{% endtab %}
{% endtabs %}

#### Example

<pre class="language-lua" data-title="server.lua"><code class="lang-lua">local test_command = {
    command = "cosmo", -- command to use in terminal
    show = true, -- Set to true if you want the command to be visible in the terminal command list
    allowed = function(playerId, laptopSerial)
        return true
    end,
    onSuccess = function(playerId, laptopSerial)
        local playerMoney = exports['av_laptop']:getMoney(playerId, "cosmo") or 0
<strong>        local actions = {
</strong>            {
                type = "text",
                input = "Your current Cosmo balance is: "..playerMoney,
                delay = 600
            },
        }
        TriggerClientEvent("av_laptop:terminal", playerId, actions)
        return true
    end,
    canProcess = function(playerId, laptopSerial, args)
        return true
    end,
    actions = {
        {type = "progressbar", input = "Fetching player Cosmo...", delay = 3000},
    },
}

CreateThread(function()
    while not GetResourceState('av_laptop') == 'started' do
        Wait(100)
    end
    local added, msg = exports['av_laptop']:addCommand(test_command)
    print("Adding terminal command:", added, msg)
end)
</code></pre>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.av-scripts.com/laptop-pack-v3/laptop-v3/terminal/events.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
