# how to change 1 value only

## Recommended Posts

Posted (edited)

How to change 't1' value only? pls answer

example:

function A()

gg.searchNumber(500, gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)

revert = gg.getResults(1)

local t = gg.getResults(1)

gg.clearResults()

B()

end

function B()

gg.searchNumber(300, gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)

revert1 = gg.getResults(1)

local t1 = gg.getResults(1)

gg.clearResults()

CH()

end

function CH()

for i, v in ipairs(t) do

v.flags = gg.TYPE_DWORD

v.value = 5

end

gg.setValues(t)

CH2()

end

function CH2()

for i, v in ipairs(t1) do

v.flags = gg.TYPE_DWORD

v.value = 10

end

gg.setValues(t1)

end

RESULTS = values 't' = 10

values 't1' = 10

i want is

RESULTS = values 't' = 5

values 't1' = 10

Edited by RezaHaxz

##### Share on other sites

Posted (edited)
```function A()
gg.searchNumber(500, gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)
local t = gg.getResults(1)

for i, v in ipairs(t) do
if v.flags == gg.TYPE_DWORD then
v.value = 5
end
end
gg.setValues(t)
t = nil
gg.clearResults()
end

function B()
gg.searchNumber(300,gg.TYPE_DWORD, false,gg.SIGN_EQUAL, 0, -1)
local t1 = gg.getResults(1)

for i, v in ipairs(t1) do
if v.flags == gg.TYPE_DWORD then
v.value = 10
end
end
gg.setValues(t1)
t = nil
gg.clearResults()
end```

Edited by zam535582

##### Share on other sites
13 hours ago, zam535582 said:
```
function A()
gg.searchNumber(500, gg.TYPE_DWORD, false, gg.SIGN_EQUAL, 0, -1)
local t = gg.getResults(1)

for i, v in ipairs(t) do
if v.flags == gg.TYPE_DWORD then
v.value = 5
end
end
gg.setValues(t)
t = nil
gg.clearResults()
end

function B()
gg.searchNumber(300,gg.TYPE_DWORD, false,gg.SIGN_EQUAL, 0, -1)
local t1 = gg.getResults(1)

for i, v in ipairs(t1) do
if v.flags == gg.TYPE_DWORD then
v.value = 10
end
end
gg.setValues(t1)
t = nil
gg.clearResults()
end```

Thank you sir