Many thanks to @AvarianKnight for assisting someone there with it - only tagged as it is a direct copy paste from discord of their example.
Hopefully this helps others at some point.
AddStateBagChangeHandler('staticVehicleCoords', nil, function(bagName, key, value, _, _)
local startedTask = false
local entNet = bagName:gsub('entity:', '') -- just gets the net id
if not value then return end
-- value should be a vec3 with target coords
while NetworkDoesEntityExistWithNetworkId(entNet) do
local veh = NetToVeh(entNet)
if NetworkGetEntityOwner(veh) == PlayerId() then
if not startedTask then
startedTask = true
TaskVehicleDriveToCoordLongrange(GetPedInVehicleSeat(veh, -1), veh, value, 1.0, 1, 1)
end
else
startedTask = false
end
Wait(250)
end
end)