Jump to content
  • 0

Ui click prompt menu


Luffy_Op
 Share

Question

so i am recently working on a lua script for plants vs zombies but I'm getting a issue on sun hack because we have to find the number in dword then refine the number then edit the number so i want to make a prompt menu for sun value then when we click on GG button the 2 prompt menu should open so  anyone can help me 🙏🏼

Link to comment
Share on other sites

Recommended Posts

  • 0
5 hours ago, Luffy_Op said:

did you see the video above i need like that

 

Yes, I saw, but did not understand what you are doing 🙂

5 hours ago, Luffy_Op said:

 i have made the all Script but I'm getting errors on prompt search menu

 

Then show the part of the script where the error occurs

Link to comment
Share on other sites

  • 0
5 hours ago, Luffy_Op said:

.. i have made the all Script but I'm getting errors on prompt search menu

 

then show that prompt search menu part that you made that gave you error.

so people can fix it.

Edited by MonkeySAN
Link to comment
Share on other sites

  • 0

[ @Luffy_Op ]
---
We are not wizards, here's what we need to help you:
- Explain the exact problem concisely. So far, you're only doing request instead of asking for help. ("i need like that")
- Attach your script here, so we can help you fixing it.
- Use a better choice of words with proper punctuation. This will help us to better understand your problem.
---
Judging of your video, is this what you are looking for?

function menus()
	gg.alert('Click on GG button to continue')
	gg.setVisible(false)
	knxs = 1
end

function continous()
	gg.alert('You reach the second code execution')
	gg.setVisible(false)
	knxs = 0
end

knxs = 0
while true do
    if gg.isVisible(false) then
		if knxs == 1 then
			continous()
		else
			menus()
		end
    end
end

---

Edited by Xaviesz
Link to comment
Share on other sites

  • 0
6 hours ago, MonkeySAN said:

then show that prompt search menu part that you made that gave you error.

so people can fix it.

wait

So this my script if you on the function a1() 

I have done 1 number prompt for Searching value then i have just put a alert and then sleep for then the 2 number prompt will that will refine and edit the value but the script getting error

so i want to make it like when we put some value on 1 prompt for Searching GG will then He will Give A alert that Click on GG button For continue like that

Luffy_Op PVZ.lua

Link to comment
Share on other sites

  • 0
function a1()
menu = gg.prompt({"Your Sun"}, {0}, {"number"})
if not menu then return else --cancel will return to main menu

gg.searchNumber(menu[1], gg.TYPE_DWORD)
gg.getResults(gg.getResultsCount())
gg.alert(" Spend Or Collect Sun then tap GG icon to open the next step ")

 --this will open GG to 2nd prompt only when the icon is tap.
while true do
if gg.isVisible() then
gg.setVisible(false)
break
end
end

menu = gg.prompt({"Your Current Sun value"}, {0}, {"number"})
if not menu then gg.clearResults() return else --cancel will clear all results and return to main menu

gg.refineNumber(menu[1],gg.TYPE_DWORD)
gg.getResults(gg.getResultsCount())
gg.editAll("10000", gg.TYPE_DWORD)
end
end
end

 

Edited by MonkeySAN
Link to comment
Share on other sites

  • 0

[ @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

Edited by Xaviesz
fix choice to choices
Link to comment
Share on other sites

  • 0
2 hours ago, Xaviesz said:

[ @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 5.02 kB · 2 downloads

thank you @MonkeySan @Xaviesz

Bro i have one more doubt can we make a number prompt for the user that who doesn't want 10000 sun limit so they can put there there number for sun changed 

 

Link to comment
Share on other sites

  • 0
41 minutes ago, Luffy_Op said:

thank you @MonkeySan @Xaviesz

Bro i have one more doubt can we make a number prompt for the user that who doesn't want 10000 sun limit so they can put there there number for sun changed 

 

Screenshot_20230901-213359719.thumb.jpg.0abebea529529f7d28de4afa66d5687c.jpg

 

Screenshot_20230901-213404740.thumb.jpg.43d0583d6dc167496d17618beb563f1f.jpg

Link to comment
Share on other sites

  • 0
5 hours ago, Xaviesz said:

[ @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 5.02 kB · 2 downloads

So i check the menu it's getting some error in social it doesn't go back on menu so how to fix it.

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.