PhysicsClient

attachRopeToEntity

ATTACH_ROPE_TO_ENTITY0x4B490A6832559A65

The GTA V native ATTACH_ROPE_TO_ENTITY of the PHYSICS namespace, as LS:MP client scripts call it: the global function attachRopeToEntity, in JavaScript and in Lua.

SignatureJavaScript
attachRopeToEntity(
  ropeId: number,
  entity: Entity,
  x: number,
  y: number,
  z: number,
  p5: boolean
): void
SignatureLua
attachRopeToEntity(
  ropeId: integer,
  entity: Entity,
  x: number,
  y: number,
  z: number,
  p5: boolean
)

Usage

JavaScript
attachRopeToEntity(ropeId, entity, x, y, z, p5);
Lua
attachRopeToEntity(ropeId, entity, x, y, z, p5)

Three consecutive numbers can be given as one vector: { x, y, z } (or [x, y, z]) in JavaScript, a Vector3 in Lua.

JavaScript · with vectors
attachRopeToEntity(ropeId, entity, pos, p5);
Lua · with vectors
attachRopeToEntity(ropeId, entity, pos, p5)

Parameters

ParameterTypeJavaScriptLua
ropeIdintnumberinteger
entityEntitynumberinteger
xfloatnumbernumber
yfloatnumbernumber
zfloatnumbernumber
p5BOOLbooleanboolean

Returns

Nothing. In JavaScript the call evaluates to undefined.

Notes

From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.

The position supplied can be anywhere, and the entity should anchor relative to that point from it's origin.

Reference

Namespace
Physics PHYSICS
In the game
void ATTACH_ROPE_TO_ENTITY(int ropeId, Entity entity, float x, float y, float z, BOOL p5)
Hash
0x4B490A6832559A65

Open in the interactive natives reference