# TASK::TASK_FOLLOW_WAYPOINT_RECORDING

- **Hash:** `0x0759591819534F7B`
- **Namespace:** TASK
- **Runtime name (Lua/JS):** `TaskFollowWaypointRecording`
- **Side:** client (game native)
- **Name status:** official
- **Documentation:** described
- **Since game build:** 1207
- **URL:** https://natives.borderlinerp.com/natives/TASK/TASK_FOLLOW_WAYPOINT_RECORDING

## Signature

```c
void TASK_FOLLOW_WAYPOINT_RECORDING(Ped ped, const char* waypointRecording, int startIndex, int flags, int endIndex, BOOL patrol, BOOL aimWeapon, int durationMs);
```

## Parameters

- `ped` (`Ped`)
- `waypointRecording` (`const char*`)
- `startIndex` (`int`)
- `flags` (`int`)
- `endIndex` (`int`)
- `patrol` (`BOOL`)
- `aimWeapon` (`BOOL`)
- `durationMs` (`int`)

## Returns

`void`

## Description

*Source: alloc8or RDR3 NativeDB*

Follow a loaded waypoint recording. startIndex/endIndex bound the segment; patrol makes it loop back-and-forth; aimWeapon sets aiming stance; durationMs=-1 for natural pacing, otherwise caps time (snaps to end on expiry).

*Source: VORPCORE RDR3natives*

Orders ped to follow a waypoint recording with control over start/end node indices, optional patrol (back-and-forth) behavior,aiming stance, and total traversal duration
NOTES:The recording must be requested and loaded using `REQUEST_WAYPOINT_RECORDING`.
The indices (startIndex, endIndex) restrict which part of the route is used.
patrol controls whether the ped returns to the start after reaching the end.
aimWeapon only affects stance — no firing occurs.
duration determines total task time before snapping to the end node
https://www.youtube.com/watch?v=RIsXDJSmeGU

## Usage

### Lua

```lua
TaskFollowWaypointRecording(ped, waypointRecording, startIndex, flags, endIndex, patrol, aimWeapon, durationMs)

-- always available, by hash
Citizen.InvokeNative(0x0759591819534F7B, ped, waypointRecording, startIndex, flags, endIndex, patrol, aimWeapon, durationMs)
```

### JavaScript

```js
TaskFollowWaypointRecording(ped, waypointRecording, startIndex, flags, endIndex, patrol, aimWeapon, durationMs);

// by hash
Citizen.invokeNative('0x0759591819534F7B', ped, waypointRecording, startIndex, flags, endIndex, patrol, aimWeapon, durationMs);
```

### C#

```csharp
Function.Call((Hash)0x0759591819534F7B, ped, waypointRecording, startIndex, flags, endIndex, patrol, aimWeapon, durationMs);
```

*Sources: alloc8or RDR3 NativeDB, VORPCORE RDR3natives.*
