I have a solution for you, but let's review your code first.
1) There are many redundant calls to clearResults function. Consecutive applying of this function is completely useless.
2) One redundant call to searchNumber function. And why would you specify "gg.TYPE_DOUBLE" in the first search, if you are searching for ONE FLOAT value according to the search string? These calls have same effect: GG performs a search for value "1.91249990463" of float type.
Here is the example of how your function could be rewritten to fix the above-mentioned redundancies and to add the ability to modify only required results leaving others untouched:
function AIMBOT ()
gg.toast('Loading Aimbot')
gg.clearResults()
gg.searchNumber("1.91249990463", gg.TYPE_FLOAT)
local results = gg.getResults(10)
local targetResultsNumbers = {2, 5, 8} -- table with numbers of results to modify, other results won`t be touched
local elementsToModify = {}
for i, v in ipairs(targetResultsNumbers) do
if results[v] ~= nil then
table.insert(elementsToModify, {address = results[v].address; flags = results[v].flags; value = '999999'})
end
end
if #elementsToModify > 0 then
gg.setValues(elementsToModify)
end
gg.clearResults()
gg.toast('Aimbot Enabled')
end