# getPedTask (Client)

> Gets the task a ped runs in a slot and all its subtasks.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Client
- **Category**: Peds
- **URL**: https://wiki.mymp.gg/en/getPedTask

## Syntax

```lua
string|false getPedTask(ped ped, string priority, int slot)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `ped` | `ped` | The ped or player. |
| `priority` | `string` | `primary` or `secondary`. |
| `slot` | `int` | The slot. Primary: `0` physical response, `1` temporary event response, `2` permanent event response, `3` primary, `4` default. Secondary: `0` attack, `1` duck, `2` say, `3` facial, `4` partial animation, `5` IK. |

## Returns

The task's name followed by each subtask's name, from the most general to the simplest, such as `TASK_COMPLEX_JUMP`, `TASK_SIMPLE_JUMP`. `false` if the priority is invalid or the slot does not exist or is empty.

## Example

```lua
local task, subtask = getPedTask(localPlayer, "primary", 3)
if task then
    print(task, subtask)
end
```

## See also

- [getPedSimplestTask (Client)](https://wiki.mymp.gg/en/getPedSimplestTask.md): Gets the simplest task the ped is running right now.
- [isPedDoingTask (Client)](https://wiki.mymp.gg/en/isPedDoingTask.md): Tells whether a ped is running a task, in any slot and at any subtask level.
- [killPedTask (Client)](https://wiki.mymp.gg/en/killPedTask.md): Removes the task a ped runs in a slot.
