You could try to loop it through a thread, this is what I do to change the driving styles / speeds based on the location. While combining the below method, you could also use this native… Native Reference - Cfx.re Docs

function speedthefuckup()
	Citizen.CreateThread(function()
		while true do
			Wait(100)
			if IsEntityInArea(prisonBus, 410.566, -580.4334, 28.72797, 2014.971, 2564.957, 54.63419) then -- Highway
				-- print("Highway")
				SetDriveTaskCruiseSpeed(copPed, 50.0)
			elseif IsEntityInArea(prisonBus, 2021.39, 2571.746, 54.64583, 2426.741, 2857.89, 48.94244) then -- Prior to 68 Ramp + Ramp
				-- print("Ramp")
				SetDriveTaskCruiseSpeed(copPed, 12.0)
			elseif IsEntityInArea(prisonBus, 1978.467, 2641.469, 46.35927, 1828.94, 2608.301, 45.58876) then -- Entry to Bollingbrooke.
				-- print("Entry")
				SetDriveTaskCruiseSpeed(copPed, 8.0)
			end
		end
	end)
end
2 Likes