maybe this will work?
local nBV = {
[1248889551] = 2000,
[1248889552] = 4000,
[1248889553] = 6000,
[1248889554] = 8000,
[1248889555] = 10000}
local PromptN = gg.prompt({[2] = 'Enter Current Gold Storage Capacity :', [1] = 'Enter Ideal Gold Storage Capacity : [2000 ~ 10000]'}, {[2] = 2000, [1] = 10000}, {[2] = 'number', [1] = 'number'})
if not PromptN or PromptN[1] == "" or PromptN[2] == "" then gg.toast('Canceling, Please Enter a Value!')
else
local num1 = PromptN[1]
local num2 = PromptN[2]
gg.clearResults()
gg.clearList()
-- Find the key corresponding to the user input value
local targetKey
local editKey
for k, v in pairs(nBV) do
if v == tonumber(num2) then
targetKey = k
elseif
v == tonumber(num1) then
editKey = k
end
end
-- Search and replace the current value with the target value
if targetKey and editKey then
gg.alert("Search value = "..targetKey.."\nEdit with = "..editKey)
gg.searchNumber(targetKey, gg.TYPE_DWORD)
local result = gg.getResults(gg.getResultsCount())
if #result == 0 then gg.alert("Values not found") os.exit() end
gg.editAll(editKey, gg.TYPE_DWORD)
else
gg.toast('Value not found in the table!')
end
gg.clearList()
gg.clearResults()
end