Not keep the code that work but added the interior and the end of each pos like this
table = {
{2259, -1222, 1049, 1186, -1234, 18, 10}
}
local i = math.random(#locations)
marker =createMarker(locations[i][1], locations[i][2], locations[i][3], 'cylinder', 3)
setElementInterior(marker, locations[i][7])
createBlip(locations[i][4], locations[i][5], locations[i][6])