NativeHub
All NativesModelsArtifactsCFXVehicle

Not affiliated with Rockstar Games or Take-Two Interactive. FiveM and Cfx.re are trademarks of their respective owners. cfxnatives.dev is an independent community project.

Maintained by uz-scripts

© 2026 cfxnatives.dev

contact@cfxnatives.dev
PHYSICSClient
Artifact25963
Data sourced from jgscripts artifact-db

AddRope

Docs
local retval, unkPtr = AddRope(x, y, z, rotX, rotY, rotZ, maxLength, ropeType, initLength, minLength, lengthChangeRate, onlyPPU, collisionOn, lockFromFront, timeMultiplier, breakable)

Description

Creates a rope at the specific position, that extends in the specified direction when not attached to any entities.
__
Rope does NOT interact with anything you attach it to, in some cases it make interact with the world AFTER it breaks (seems to occur if you set the type to -1).
Rope will sometimes contract and fall to the ground like you'd expect it to, but since it doesn't interact with the world the effect is just jaring.

There are 8 different rope types in the base game. Full rope data can be found in ropedata.xml.

enum ePhysicsRopeType {
    RopeThin = 0, // Verticies: 1, Radius: 0.03, Textures: rope & rope_n
    RopeWire6 = 1, // Verticies: 4, Radius: 0.015, Textures: steel_cable & steel_cable_n
    RopeWire32 = 2, // Verticies: 32, Radius: 0.025, Textures: steel_cable & steel_cable_n
    RopeMesh = 3, // Verticies: 6, Radius: 0.03, Textures: rope & rope_n
    RopeThinWire32 = 4, // Verticies: 32, Radius: 0.01, Textures: rope & rope_n
    RopeReins = 5, // Verticies: 32, Radius: 0.005, Textures: rope & rope_n
    RopeThin4 = 6, // Verticies: 4, Radius: 0.03, Textures: rope & rope_n
    RopeWire64 = 7 // Verticies: 64, Radius: 0.025, Textures: steel_cable & steel_cable_n
}

Parameters

NameTypeDescription
xfloatSpawn coordinate X component.
yfloatSpawn coordinate Y component.
zfloatSpawn coordinate Z component.
rotXfloatRotation X component.
rotYfloatRotation Y component.
rotZfloatRotation Z component.
maxLengthfloatThe maximum length the rope can droop.
ropeTypeintThe zero-based index of the entry in the `ropedata.xml` file. *NOTE: Using an index which does not exist will crash the game. As of game build 3258, valid values are from `0` to `7` inclusive.*
initLengthfloatThe initial length of the rope.
minLengthfloatThe minimum length the rope can be.
lengthChangeRatefloatThe speed in which the rope will wind if winding is started.
onlyPPUBOOL—
collisionOnBOOLWhether the rope should have collision. In original scripts this is followed by a LoadRopeData call when set.
lockFromFrontBOOLIf max length is zero, and this is set to false the rope will become rigid (it will force a specific distance, what ever length is, between the objects).
timeMultiplierfloatThe speed as which physics should run at. 1.0f is normal, 2.0f is twice as fast, -1.0f is time going backwards. This can affect gravity, etc.
breakableBOOLWhether shooting the rope will break it.
unkPtrAny*Unknown pointer, always 0 in original scrips.
📍Quick Snippet: Get Coordinates
xyzrotX

Add this command to your client script to retrieve precise locations in-game.

-- Add this to your client.lua. Type /pos in-game to copy coords.
RegisterCommand('pos', function()
    local ped = PlayerPedId()
    local coords = GetEntityCoords(ped)
    local heading = GetEntityHeading(ped)
    local output = string.format("vector4(%.2f, %.2f, %.2f, %.2f)", coords.x, coords.y, coords.z, heading)

    print(output)
    TriggerEvent('chat:addMessage', { args = { '^4[COORD]^0', output } })
end)

Returns

int

Returns an integer value.

Examples

Official
local function cleanup_rope_textures()
	-- we only want to cleanup if there are no other ropes still left on the map
	-- otherwise we'll make them go invisible.
	if #GetAllRopes() == 0 then
		-- there are no ropes on the map, we're safe to unload the textures.
		RopeUnloadTextures()
	end
end

CreateThread(function()
	-- if textures aren't loaded then we need to load them
	if not RopeAreTexturesLoaded() then
		-- load the textures so we can see the rope
		RopeLoadTextures()
		while not RopeAreTexturesLoaded() do
			Wait(0)
		end
	end

	-- Create a rope and store the handle
	local rope = AddRope(-2096.096, -311.906, 14.51, 0.0, 0.0, 0.0, 10.0, 1, 10.0, 0.0, 1.0, false, false, false, 1.0, false, 0)
	-- Check if the rope exists.
	if not DoesRopeExist(rope) then
		cleanup_rope_textures()
		-- If the rope does not exist, end the execution of the code here.
		return
	end
	-- Let the rope exist for 3 seconds
	Wait(3000)
	-- Delete the rope!
	DeleteRope(rope)
	cleanup_rope_textures()
end)

Server Artifacts

Data sourced from jgscripts artifact-db
Recommended25963
Known Issues24
25987-25988Node.js sandboxing seems to be causing issues for people - best to avoid for now
21547Multiple (unconfirmed) reports of server-sided natives throwing errors or causing crashes; best to avoid
17462Failed build, ignore
16276Multiple reports of issues loading JS within resources
14583-14716Crash when using the new onEntityBucketChange
14583-14862Timeouts due to latency units being in nanoseconds
13759-13890Mumble (voice) external connections blocked by default
13380-13458Server crashing due to integer encoding (PR#3235)
13079Failed Linux build (works OK if using Windows!)
12933-13045Still crashes (sometimes) when restarting resources due to Node.js 22
12913-12932Causes a crash when restarting Node.js 22
12767os.date() appends null terminator; can break Lua scripts
12651Failed Linux build, ignore
12509Failed build, ignore
12255Unconfirmed, but several reports of server-side issues that don't persist when downgrading; best to avoid
12160-12165Cannot use entity native calls in entityRemoved
12151Crashing if using newest title update (TU)
12092-12135SetPlayerModel may cause SIGSEGV crashes on some clients due to changes in player handling. 12031 and below works fine.
12078-12083Some clients will fail to connect with 'ReadBulk of header failed' error
10930Failed build, ignore
10268-10309sv_experimentalNetGameEventHandler enabled by default; can cause server crashing and reports of issues downgrading after upgrading
10191GetVehicleNumberPlateText server native broken, will cause issues with scripts involving vehicles
10072Crashing when players join
8509State bags not replicated to clients

CommunitySnippets

No snippets yet. Be the first to contribute!