# PED::_CREATE_GRAVITY_WELL

- **Hash:** `0x4F5EBE70081E5A20`
- **Namespace:** PED
- **Runtime name (Lua/JS):** `CreateGravityWell`
- **Side:** client (game native)
- **Name status:** community guess (may change)
- **Documentation:** described
- **Since game build:** 1207
- **URL:** https://natives.borderlinerp.com/natives/PED/_CREATE_GRAVITY_WELL

## Signature

```c
int _CREATE_GRAVITY_WELL(float xPos, float yPos, float zPos, float heading, float radius, float p5, float p6, float p7, BOOL stopAtDestination);
```

## Parameters

- `xPos` (`float`)
- `yPos` (`float`)
- `zPos` (`float`)
- `heading` (`float`)
- `radius` (`float`)
- `p5` (`float`)
- `p6` (`float`)
- `p7` (`float`)
- `stopAtDestination` (`BOOL`)

## Returns

`int`

## Description

Creates a handle to an instance of "CScriptResource_GravityWell", this system forces local ped to target specified position when moving, however player still can interrupt this.
Can be useful to "point" player at some specific position.
Only works while on-foot.

_CREATE_[P-Z]

## Usage

### Lua

```lua
local retval = CreateGravityWell(xPos, yPos, zPos, heading, radius, p5, p6, p7, stopAtDestination)

-- always available, by hash
local retval = Citizen.InvokeNative(0x4F5EBE70081E5A20, xPos, yPos, zPos, heading, radius, p5, p6, p7, stopAtDestination, Citizen.ResultAsInteger())
```

### JavaScript

```js
const retval = CreateGravityWell(xPos, yPos, zPos, heading, radius, p5, p6, p7, stopAtDestination);

// by hash
const retval = Citizen.invokeNative('0x4F5EBE70081E5A20', xPos + 0.0000001, yPos + 0.0000001, zPos + 0.0000001, heading + 0.0000001, radius + 0.0000001, p5 + 0.0000001, p6 + 0.0000001, p7 + 0.0000001, stopAtDestination, Citizen.returnResultAnyway(), Citizen.resultAsInteger());
```

### C#

```csharp
int retval = Function.Call<int>((Hash)0x4F5EBE70081E5A20, xPos, yPos, zPos, heading, radius, p5, p6, p7, stopAtDestination);
```

- 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.
- The name is a community guess and may change. If the named call is missing in your client build, use `InvokeNative` with the hash — it always works.

## See also

- [PED::_REMOVE_GRAVITY_WELL](https://natives.borderlinerp.com/natives/PED/_REMOVE_GRAVITY_WELL.md) — Removes gravity well by handle returned from 0x4F5EBE70081E5A20

*Sources: alloc8or RDR3 NativeDB.*
