Jump to content
We are investigating issues where accounts became locked on login attempt #1. Lock feature disabled for now. ×

How to Freeze in Range in a lua script


 Share

Recommended Posts

hi im about to complete my lua script and only missing this one since and i cant seem to find anything about it, can someone help me please on how to Freeze in Range like from -5 to 5? like in the picture i attached

Untitled.png

Edited by Chupul
Link to comment
Share on other sites

--
revert = gg.getResults(999, nil, nil, nil, nil, nil, nil, nil, nil)
local t = gg.getResults(999, nil, nil, nil, nil, nil, nil, nil, nil)
for i, v in ipairs(t) do
	if v.flags == gg.TYPE_DWORD then
		v.value = "-1"
		v.freeze = true
		v.freezeType = gg.FREEZE_IN_RANGE
		v.freezeFrom = "-5"
		v.freezeTo = "5"
	end
end
gg.addListItems(t)
t = nil

 

Link to comment
Share on other sites

On 10/1/2021 at 7:52 AM, Chupul said:

hi im about to complete my lua script and only missing this one since and i cant seem to find anything about it, can someone help me please on how to Freeze in Range like from -5 to 5? like in the picture i attached

Untitled.png

gg.searchNumber(123, gg.TYPE_DWORD)
local found = gg.getResults(gg.getResultsCount())
local valFreeze = {}
for a, b in next, {-5, -4, -3, -2, -1, 1, 2, 3, 4, 5} do
  valFreeze[b] = a
end
for a, b in next, found do
  if valFreeze[b.value] then
    b.freeze = true--more freeze get help in gg
  --elseif b.value == 123 then--more setting
    
  end
end
gg.addListItems(found)

Like?

Edited by HEROGAMEOfficial
Link to comment
Share on other sites

On 10/2/2021 at 10:19 AM, MonkeySAN said:
--
revert = gg.getResults(999, nil, nil, nil, nil, nil, nil, nil, nil)
local t = gg.getResults(999, nil, nil, nil, nil, nil, nil, nil, nil)
for i, v in ipairs(t) do
	if v.flags == gg.TYPE_DWORD then
		v.value = "-1"
		v.freeze = true
		v.freezeType = gg.FREEZE_IN_RANGE
		v.freezeFrom = "-5"
		v.freezeTo = "5"
	end
end
gg.addListItems(t)
t = nil

 

TYVM, with a little bit of research on for i, v in pairs i managed to make it work with my script

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.