getPedTask
Client
Gets the task a ped runs in a slot and all its subtasks.
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
local task, subtask = getPedTask(localPlayer, "primary", 3)
if task then
print(task, subtask)
end