Hello! I want to create a surprises system. On resource start it will generate x markers with coordinates from list. It have to be unique, no one markers should have the same position. And when player hit this marker, it will destroy itself and create another marker. Sorry for my bad english. My code: 
local surprisesCoords = { 
    {-2090.885, 1154.33, 67.205}, 
    {-1705.405, 1012, 17.585}, 
    {-2211.785, 622.69, 44.24}, 
    {-2186.19, 697.065, 53.89}, 
    {-2672.855, 919.92, 87.11} 
} 
local surprisesMarkers = {} 
  
local atOneTimeAmount = 2 
local allAmount = 0 
for _ in pairs(surprisesCoords) do allAmount = allAmount + 1 end 
  
function markerExists(marker) 
    for _, value in pairs(surprisesMarkers) do 
        if marker.position.x == value.position.x and marker.position.y == value.position.y then 
            return true 
        end 
    end 
  
    return false 
end 
  
function createSurprise() 
    local coords = surprisesCoords[math.random(allAmount)] 
    local marker = Marker(coords[1], coords[2], coords[3], 'corona', 1, 255, 255, 0) 
  
    if not markerExists(marker) then 
        table.insert(surprisesMarkers, marker) 
    else 
        marker:destroy() 
        createSurprise() 
    end 
end 
  
addEventHandler('onResourceStart', resourceRoot, function() 
    for i = 1, atOneTimeAmount do 
        createSurprise() 
    end 
end) 
  
addEventHandler('onMarkerHit', resourceRoot, function(element) 
    if not element.type == 'player' then return end 
  
    for index, marker in ipairs(surprisesMarkers) do 
        if marker == source then 
            source:destroy() 
            table.remove(surprises, index) 
            break 
        end 
    end 
  
    createSurprise() 
end)