[ @Luffy_Op ]
---
I have fixed your entire script with proper naming, indentation, syntax. I will list some of the changes:
cs = 'Oof'
while(true)do
if gg.isVisible(true) then
XGCK=2
gg.setVisible(false)
end
gg.clearResults()
if XGCK==2 then
Main()
end
end
You have 2 of these, doesn't make sense and will likely to interfere. The "cs" variable is useless since it is not being used anywhere
---
print('Correct')
print('WRONG PASSWORD')
print(Error)
Using print() on script doesn't shows you the message, it will be showed after you exit the script. I have replace it with gg.alert() and gg.toast()
---
gg.toast ('script is loading.')
gg.sleep (1000)
gg.toast ('script is loading..')
gg.sleep (1000)
gg.toast ('script is loading...')
gg.sleep (1000)
gg.toast ('script is loading....')
gg.sleep (1000)
gg.sleep (1200)
gg.toast("80%")
gg.sleep (1200)
gg.toast("95%")
gg.sleep (1200)
gg.toast("100%")
gg.sleep (1200)
gg.toast("Done✔")
gg.setVisible(true)
Fake loading screen is removed, you can add this back if you think this is "aesthetic"
---
menu =
if not menu then
return
Safety check is added, it will bring users back to main menu if user cancels the operation
---
function b1()
gg.setSpeed(0.0001)
gg.toast ("Speed Hack Activated")
end
These kind of function are now merged for clarity
if menu == 1 then
gg.setSpeed(0.0001)
elseif menu == 2 then
gg.setSpeed(1.0)
---
Variables name are changed to make it readable:
X -> sflags (social flags)
XGCK -> flags
a1() -> suns()
a2() -> coins()
a3() -> speeds()
a4() -> socials()
---
gg.processPause()
gg.searchNumber(menu[1], gg.TYPE_DWORD)
gg.getResults(gg.getResultsCount())
gg.processResume()
You added gg.processResume() and so I add gg.processPause(). The game will pause when values are being searched.
---
if menu3 == 1 then b1() end
if menu3 == 2 then b2() end
Double if's are now replaced with elseif
if choices == 1 then
suns()
elseif choices == 2 then
coins()
---
"Fixes" from @MonkeySAN is also been added. I hope you can improve your overall script in the future.
Luffy_Op PVZ.lua