Some example that i think can work but you have to adjust it here and there so it works for your game. Main thing to adjust is to separate your coords and that of enemy. I could not really test it so it can have some faults in syntax's or design.
gg.setRanges(gg.REGION_ANONYMOUS | gg.REGION_C_ALLOC | gg.REGION_OTHER)
gg.searchNumber('-0.082', gg.TYPE_FLOAT)
t = gg.getResults(7)
local check = {}
for i, v in ipairs(t) do
check[i] = {address = v.address + 0x10, flags = gg.TYPE_DWORD}
end
check = gg.getValues(check)
local xCoordMe = {}
local yCoordMe = {}
local zCoordMe = {}
local xCoordEnemy = {}
local yCoordEnemy = {}
local zCoordEnemy = {}
for i, v in ipairs(check) do
if v.value == 1 then -- the random value at the given offset to see if its enemy or you coordinates(1 result)
xCoord_Me[#xCoord_Me + 1] = {address = v.address + 0x38, flags = gg.TYPE_FLOAT}
yCoord_Me[#xCoord_Me + 1] = {address = v.address + 0x3C, flags = gg.TYPE_FLOAT}
zCoord_Me[#xCoord_Me + 1] = {address = v.address + 0x40, flags = gg.TYPE_FLOAT}
end
if v.value == 2 then -- (6 results)
xCoord_Enemy[#xCoord_Enemy + 1] = {address = v.address + 0x38, flags = gg.TYPE_FLOAT}
yCoord_Enemy[#xCoord_Enemy + 1] = {address = v.address + 0x3C, flags = gg.TYPE_FLOAT}
zCoord_Enemy[#xCoord_Enemy + 1] = {address = v.address + 0x40, flags = gg.TYPE_FLOAT}
end
end
xCoordMe = gg.getValues(xCoordMe)
yCoordMe = gg.getValues(yCoordMe)
zCoordMe = gg.getValues(zCoordMe)
xCoordEnemy = gg.getValues(xCoordEnemy)
yCoordEnemy = gg.getValues(yCoordEnemy)
zCoordEnemy = gg.getValues(zCoordEnemy)
local final = {}
local getCoordsEnemy = {}
for i = 1, #xCoordEnemy do
final[#final+1] = string.format("Your Player: x = %.15f, y= %.15f, z = %.15f", xCoordMe[i].value, yCoordMe[i].value, zCoordMe[i].value)
final[#final+1] = string.format("Enemy Player: x = %.15f, y= %.15f, z = %.15f", xCoordEnemy[i].value, yCoordEnemy[i].value, zCoordEnemy[i].value)
getCoordsEnemy[#getCoordsEnemy+1] = {[1] = xCoordEnemy[i].value, [2] = yCoordEnemy[i].value, [3] = zCoordEnemy[i].value} -- edited(wrong variable name)
end
menu = gg.choice(final)
if menu == nil then
gg.toast("nothing selected")
else
xCoordMe[1].value = getCoordsEnemy[menu][1]
yCoordMe[1].value = getCoordsEnemy[menu][2]
zCoordMe[1].value = getCoordsEnemy[menu][3]
gg.setValues(xCoordMe)
gg.setValues(yCoordMe)
gg.setValues(zCoordMe)
end
Did some corrected in script.