# TASK::TASK_FOLLOW_TO_OFFSET_OF_ENTITY

- **Hash:** `0x304AE42E357B8C7E`
- **Namespace:** TASK
- **Runtime name (Lua/JS):** `TaskFollowToOffsetOfEntity`
- **Side:** client (game native)
- **Name status:** official
- **Documentation:** named only
- **Since game build:** 1207
- **URL:** https://natives.borderlinerp.com/natives/TASK/TASK_FOLLOW_TO_OFFSET_OF_ENTITY

## Signature

```c
void TASK_FOLLOW_TO_OFFSET_OF_ENTITY(Ped ped, Entity entity, float offsetX, float offsetY, float offsetZ, float movementSpeed, int timeout, float stoppingRange, BOOL persistFollowing, BOOL p9, BOOL walkOnly, BOOL p11, BOOL p12, BOOL p13);
```

## Parameters

- `ped` (`Ped`)
- `entity` (`Entity`)
- `offsetX` (`float`)
- `offsetY` (`float`)
- `offsetZ` (`float`)
- `movementSpeed` (`float`)
- `timeout` (`int`)
- `stoppingRange` (`float`)
- `persistFollowing` (`BOOL`)
- `p9` (`BOOL`)
- `walkOnly` (`BOOL`)
- `p11` (`BOOL`)
- `p12` (`BOOL`)
- `p13` (`BOOL`)

## Returns

`void`

## Description

*Source: femga rdr3_discoveries*

```
0x304AE42E357B8C7E  (by Jonaskii)

TASK_FOLLOW_TO_OFFSET_OF_ENTITY(Ped follower, Ped target, float offsetX, float offsetY, float offsetZ, float var1, float var2, float minDist, BOOL b1, BOOL b2, BOOL walkOnly, BOOL b3, BOOL b4)

follower - The ped you want to follow somebody
target - The ped you want the follow to follow
offsetX,Y,Z - Offset from target the follower will stand
minDist - Minimum distance the follower can be from the target (-1 for auto, 50f is max)
walkOnly - if true the follower can only walk

var1: found in scripts (-1, 1f, 1.2f, 2f, 2.5f )
var2: found in scripts (-1, 1.0)
Unsure what they both do, I cannot seem to find any difference when raising and lowering them. Maybe you need to have one of the Booleans active for them to take effect?
```

## Usage

### Lua

```lua
TaskFollowToOffsetOfEntity(ped, entity, offsetX, offsetY, offsetZ, movementSpeed, timeout, stoppingRange, persistFollowing, p9, walkOnly, p11, p12, p13)

-- always available, by hash
Citizen.InvokeNative(0x304AE42E357B8C7E, ped, entity, offsetX, offsetY, offsetZ, movementSpeed, timeout, stoppingRange, persistFollowing, p9, walkOnly, p11, p12, p13)
```

### JavaScript

```js
TaskFollowToOffsetOfEntity(ped, entity, offsetX, offsetY, offsetZ, movementSpeed, timeout, stoppingRange, persistFollowing, p9, walkOnly, p11, p12, p13);

// by hash
Citizen.invokeNative('0x304AE42E357B8C7E', ped, entity, offsetX + 0.0000001, offsetY + 0.0000001, offsetZ + 0.0000001, movementSpeed + 0.0000001, timeout, stoppingRange + 0.0000001, persistFollowing, p9, walkOnly, p11, p12, p13);
```

### C#

```csharp
Function.Call((Hash)0x304AE42E357B8C7E, ped, entity, offsetX, offsetY, offsetZ, movementSpeed, timeout, stoppingRange, persistFollowing, p9, walkOnly, p11, p12, p13);
```

- Float parameters: Lua integers (`10`, or whole numbers decoded from NUI/JSON) are sent as ints and read as garbage. Write `10.0` or `value + 0.0`. The generated JS wrappers add `0.0000001` to non-zero floats for the same reason.

*Sources: alloc8or RDR3 NativeDB, femga rdr3_discoveries.*
