> For the complete documentation index, see [llms.txt](https://docs.17movement.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.17movement.net/speech-recognition/custom-actions.md).

# Custom Actions

### Phrases

```lua
phrases = {
    "hey give me some money",
    -- Make as much phrases for this action you want.
},
```

Here you can add which phrases you want to execute the event&#x20;

### Actions

```lua
actionType = "event",
eventType = "client",
eventName = "17mov_SpeechRecognition:TestPhrase",
arguments = {
    arg1 = "17movement.net",
},
```

Here action type has 3 types \
1\. Event\
2\. Command\
3\. Custom Function

#### For Event&#x20;

```lua
actionType = "event",
eventType = "client", -- or "server"
eventName = "17mov_SpeechRecognition:TestPhrase",
arguments = {
    arg1 = "17movement.net", -- optional
},
```

#### For Command

```lua
actionType = "executeCommand",
commandString = "e flip",
```

#### For Custom Function

```lua
actionType = "custom",
actionFunction = function()
    -- Add here ur custom code
end,
```

#### Custom Function Example

```lua
actionType = "custom",
actionFunction = function()
    if IsPlayerFreeAiming(PlayerId()) then
        local found, targetPed = GetEntityPlayerIsFreeAimingAt(PlayerId())
        print(targetPed)
        if found then
            local dict, anim = "missminuteman_1ig_2", "handsup_base"
            while not HasAnimDictLoaded(dict) do
                RequestAnimDict(dict)
                Citizen.Wait(10)
            end
            print("PLAYING")
            TaskPlayAnim(targetPed, dict, anim, 8.0, -8.0, -1, 1, 0, false, false, false)
            Citizen.Wait(5000)
            ClearPedTasks(targetPed)
        end
    end
end,
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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.17movement.net/speech-recognition/custom-actions.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.
