# 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,
```
