a library to speed up the development of Fivem scripts and frameworks
fivem-ts - Documentation v0.7.5 • Docs
fivem-ts - Documentation v0.7.5 / Client / Rope
Class to manage ropes between entities.
new Rope(
handle
):Rope
• handle: number
get
Handle():number
Retrieves the handle of the object.
number
The handle identifier.
get
Length():number
Gets the length of the rope.
set
Length(value
):void
Sets the length of the rope force.
• value: number
The desired length of the rope force.
number
The length of the rope.
get
VertexCount():number
Gets the count of vertices in the rope.
number
The number of vertices.
activatePhysics():
void
Activates the physics simulation for the current object by calling the ActivatePhysics function with the object’s handle.
void
attachEntities(
fEntity
,fPosition
,sEntity
,sPosition
,length
):void
Attaches two entities together at specified positions using a rope.
• fEntity: Entity
The first entity to attach.
• fPosition: Vector3
The position to attach the first entity.
• sEntity: Entity
The second entity to attach.
• sPosition: Vector3
The position to attach the second entity.
• length: number
The length of the rope used to attach the entities.
void
attachEntity(
entity
,position
):void
Attaches an entity to the current object at a specified position.
• entity: Entity
The entity to be attached.
• position: Vector3
The position where the entity should be attached.
void
delete():
void
Deletes an inner resource represented by the instance handle.
This method invokes the DeleteRope function, which handles the cleanup and deletion of the resource associated with this Handle.
void
detachEntity(
entity
):void
Detaches a specified entity from the current object.
• entity: Entity
The entity to be detached.
void
exists():
boolean
Checks if the rope instance exists.
boolean
True if the rope exists, otherwise false.
getVertexCoords(
vertex
):Vector3
Retrieves the coordinates of a specified vertex for a given rope.
• vertex: number
The index of the vertex whose coordinates are to be retrieved.
A Vector3 object containing the x, y, and z coordinates of the vertex.
pinVertex(
vertex
,position
):void
Pins a vertex at a given position.
• vertex: number
The index of the vertex to pin.
• position: Vector3
The position to pin the vertex at, represented as a Vector3 object.
void
resetLength(
reset
):void
Resets the length of the rope.
• reset: boolean
If true, the rope length will be reset to 1. If false, it will reset to the current length.
void
unpinVertex(
vertex
):void
Unpins the specified vertex from the rope, making it movable again.
• vertex: number
The index of the vertex to be unpinned.
void