# PHYSICS::ATTACH_ENTITIES_TO_ROPE

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

## Signature

```c
void ATTACH_ENTITIES_TO_ROPE(int ropeId, Entity entity1, Entity entity2, float ent1X, float ent1Y, float ent1Z, float ent2X, float ent2Y, float ent2Z, float length, int alwaysZero1, int alwaysZero2, const char* boneName1, const char* boneName2, BOOL p14, int boneId1, int boneId2, int alwaysZero3, int alwaysZero4, BOOL p19, BOOL p20);
```

## Parameters

- `ropeId` (`int`)
- `entity1` (`Entity`)
- `entity2` (`Entity`)
- `ent1X` (`float`)
- `ent1Y` (`float`)
- `ent1Z` (`float`)
- `ent2X` (`float`)
- `ent2Y` (`float`)
- `ent2Z` (`float`)
- `length` (`float`)
- `alwaysZero1` (`int`)
- `alwaysZero2` (`int`)
- `boneName1` (`const char*`)
- `boneName2` (`const char*`)
- `p14` (`BOOL`)
- `boneId1` (`int`)
- `boneId2` (`int`)
- `alwaysZero3` (`int`)
- `alwaysZero4` (`int`)
- `p19` (`BOOL`)
- `p20` (`BOOL`)

## Returns

`void`

## Description

Attaches entity 1 to entity 2.
If you use a boneName (p12/p13) make sure boneId (p15/p16) is set to -1.

## Usage

### Lua

```lua
AttachEntitiesToRope(ropeId, entity1, entity2, ent1X, ent1Y, ent1Z, ent2X, ent2Y, ent2Z, length, alwaysZero1, alwaysZero2, boneName1, boneName2, p14, boneId1, boneId2, alwaysZero3, alwaysZero4, p19, p20)

-- always available, by hash
Citizen.InvokeNative(0x3D95EC8B6D940AC3, ropeId, entity1, entity2, ent1X, ent1Y, ent1Z, ent2X, ent2Y, ent2Z, length, alwaysZero1, alwaysZero2, boneName1, boneName2, p14, boneId1, boneId2, alwaysZero3, alwaysZero4, p19, p20)
```

### JavaScript

```js
AttachEntitiesToRope(ropeId, entity1, entity2, ent1X, ent1Y, ent1Z, ent2X, ent2Y, ent2Z, length, alwaysZero1, alwaysZero2, boneName1, boneName2, p14, boneId1, boneId2, alwaysZero3, alwaysZero4, p19, p20);

// by hash
Citizen.invokeNative('0x3D95EC8B6D940AC3', ropeId, entity1, entity2, ent1X + 0.0000001, ent1Y + 0.0000001, ent1Z + 0.0000001, ent2X + 0.0000001, ent2Y + 0.0000001, ent2Z + 0.0000001, length + 0.0000001, alwaysZero1, alwaysZero2, boneName1, boneName2, p14, boneId1, boneId2, alwaysZero3, alwaysZero4, p19, p20);
```

### C#

```csharp
Function.Call((Hash)0x3D95EC8B6D940AC3, ropeId, entity1, entity2, ent1X, ent1Y, ent1Z, ent2X, ent2Y, ent2Z, length, alwaysZero1, alwaysZero2, boneName1, boneName2, p14, boneId1, boneId2, alwaysZero3, alwaysZero4, p19, p20);
```

- 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.

## Related enums

- [eAnimBoneTag](https://natives.borderlinerp.com/enums/eAnimBoneTag.md) — 911 values

*Sources: alloc8or RDR3 NativeDB.*
