[Help] using AddRope() but it wont spawn

RegisterNetEvent("larryfire:firehoseon")
AddEventHandler("larryfire:firehoseon", function()
	
		  if hoserope == nil then
			hoserope = AddRope(plyrx,plyry,plyrz,0.0,0.0,0.0,20.0,4,20.0,1.0,0.0,false,false,false,5.0,false,NULL)
			AttachRopeToEntity(hoserope,targetVehicle)
        end			
		  GiveWeaponToPed(ped, firee, 1000, false, false)
		  ShowNotification("~p~[LFS] ~g~Fire Hose Enabled")
		  
end)

Wont spawn in game but command runs, let me know if you need any other details to help me!
Thanks

1 Like
local firee = GetHashKey("WEAPON_FIREEXTINGUISHER")
local plyrx, plyry, plyrz = table.unpack(GetEntityCoords(GetPlayerPed(-1), true))
local hoserope = nil
local targetVehicle = GetVehiclePedIsIn(GetPlayerPed(-1), false)

You need to request the rope and load the textures. Plus the rope natives arent synced client to client.

1 Like

How do i request the rope and what is the texture dictionary for it

You just need to go on the natives DB and look at the rope natives.

Thanks for the help, I think i found what I was looking for and I am testing it now

Loaded the textures still wont spawn

 if hoserope == nil then
			hoserope = AddRope(plyrx,plyry,plyrz,0.0,0.0,0.0,20.0,4,20.0,1.0,0.0,false,false,false,5.0,false,NULL)
			RopeLoadTextures()
			AttachRopeToEntity(hoserope,targetVehicle)
        end		

? can you send code

local spawnedRope = nil

Citizen.CreateThread(function()
	while true do
		if IsControlJustPressed(1, 38) then
			if spawnedRope == nil then
				SpawnRope()
			else
				RemoveRope()
			end
		end
		Citizen.Wait(0)
	end
end)

function SpawnRope()
	local ped = GetPlayerPed(PlayerId())
	local pedPos = GetEntityCoords(ped, false)
	RopeLoadTextures()
	local rope = AddRope(pedPos.x, pedPos.y, pedPos.z, 0.0, 0.0, 0.0, 10.0, 2, 10.0, 1.0, 0, 0, 0, 0, 0, 0, 0)
	AttachRopeToEntity(rope, ped, pedPos.x, pedPos.y, pedPos.z, 1)
	spawnedRope = rope
	print("SPAWNED ROPE: " .. spawnedRope)
end

function RemoveRope()
	RopeUnloadTextures()
	DeleteRope(spawnedRope)
	spawnedRope = nil
	print("DELETED ROPE")
end

Thanks for all the help almost finished with this script now!