Not sure which part you do not understand, I guess the second method i mentioned. Here is an example how to implement what I said there.
For example you are going to hack 3 items in the store.
Item A 500 gold
Item B 1300 gold
Item C 2000 gold
local ITEM_PRICE = {{"Item A", 500}, {"Item B", 1300}, {"Item C", 2000}}
--[[Store your item here, Name with price. Or you can create more list according to their categories]]
local ITEM_NAME = {} --[[Let's store the name in here]]
for item, properties in pairs(ITEM_PRICE) do
ITEM_NAME[#ITEM_NAME+1] = properties[1]
end
function buyItem(TYPE)
gg.clearResults()
local select = gg.choice(ITEM_NAME, nil, "ITSSC ITEM STORAGE")
gg.searchNumber(ITEM_PRICE[select][2], TYPE)
gg.getResults(gg.getResultsCount())
gg.editAll(-ITEM_PRICE[select][2], TYPE)
end
buyItem(4)