# isPedDoingTask (Client)

> Tells whether a ped is running a task, in any slot and at any subtask level.

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

## Syntax

```lua
bool isPedDoingTask(ped ped, string taskName)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `ped` | `ped` | The ped or player. |
| `taskName` | `string` | The task's name, such as `TASK_SIMPLE_SWIM`. Case does not matter. |

## Returns

`true` if the task is under way, `false` if not or if the ped does not exist in the game.

## Example

```lua
if isPedDoingTask(localPlayer, "TASK_SIMPLE_SWIM") then
    print("Swimming")
end
```

## See also

- [getPedTask (Client)](https://wiki.mymp.gg/en/getPedTask.md): Gets the task a ped runs in a slot and all its subtasks.
- [getPedSimplestTask (Client)](https://wiki.mymp.gg/en/getPedSimplestTask.md): Gets the simplest task the ped is running right now.
- [killPedTask (Client)](https://wiki.mymp.gg/en/killPedTask.md): Removes the task a ped runs in a slot.
