> For the complete documentation index, see [llms.txt](https://docs.av-scripts.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.av-scripts.com/laptop-pack/laptop/terminal/events.md).

# 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/laptop/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>
