Jump to content
  • 0

Error when press outside gg ui frame and then press the gg icon again


MrJ77

Question

For example, I want when a player enters the Hack1 menu and finds a list of things, for example, presses outside the gg ui frame and then presses the gg icon again, an error occurs, I want to return to my last list how it was

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

On 6/24/2022 at 7:46 AM, MrJ77 said:

I dont know what's wrongScreenshot_2022-06-24-18-42-51-52.thumb.png.4853114512b34113692eaff554fd7df1.png

It's a script error. gg ui functions only return what you entered if you press ok. If you click cancel or click off of it, it returns nil. So you expect it to return an array of data, instead it returns nil. The easiest way to fix this would be this code:

input = nil -- set it to nil because we have not prompted for input yet

while input == nil do -- repeat until ok button clicked

gg.prompt("Make sure to click ok!") -- your ui function here
end

alert = input[1] -- if you used gg.prompt, it returns an array, with what you entered as array entry #1

gg.alert("What you entered:" .. alert) -- to demonstrate

 

Link to comment
Share on other sites

8 hours ago, MrJ77 said:

For example, I want when a player enters the Hack1 menu and finds a list of things, for example, presses outside the gg ui frame and then presses the gg icon again, an error occurs, I want to return to my last list how it was

Can you send a picture of the error please?

Link to comment
Share on other sites

I don't know whats wrong in my script

 

gg.alert("Mr.J\nDynamons 2 Script", "Oke")

gg.toast("Mr.J")

while true do

  if gg.isVisible(true) then

     menuk = 1

     gg.setVisible(false)

   end

   START = 1

   function START()

   menu = gg.choice({

    "Koin",

       "Keluar"

       }, nil, "Script Ini Dibuat Oleh Mr.J")

       if menu == 1 then

          ch1()

        end

       if menu == 2 then

           os.exit()

        end

       if menu == nil then

       else

       end

       menuk = -1

     end

     

     function ch1()

     prompt = gg.prompt({[1]="Nilai Koin Sekarang"}, {}, {"number"}) gg.searchNumber(prompt[1], gg.TYPE_DWORD)

     gg.getResults(100)

     prompt = gg.prompt({[2]="Nilai Koin Sekarang Yang Sudah Berubah"}, {}, {"number"}) gg.refineNumber(prompt[2], gg.TYPE_DWORD)

     gg.getResults(100)

     prompt = gg.prompt({[3]="Nilai Koin Yang Di Inginkan"}, {}, {"number"}) gg.editAll(prompt[3], gg.TYPE_DWORD)

     gg.clearResults()

     gg.toast("Thanks For Using My Script")

     gg.alert("Jangan Buru² Buat Beli, Selesaikan Semua Tutorialnya Dulu Biar Ga Ngebug", "Oke")

     end

     

 

    if menuk == 1 then

    Screenshot_2022-06-24-18-42-51-52.thumb.png.ba7a68cce3e36653c3bf7c4eafac30f7.png   START()

     end

   end

     

     

Link to comment
Share on other sites

On 6/24/2022 at 3:04 AM, HorridModz said:

Can you send a picture of the error please?

This is my script

I don't know whats wrong in my script

gg.alert("Mr.J\nDynamons 2 Script", "Oke")

gg.toast("Mr.J")

while true do

  if gg.isVisible(true) then

     menuk = 1

     gg.setVisible(false)

   end

   START = 1

   function START()

   menu = gg.choice({

    "Koin",

       "Keluar"

       }, nil, "Script Ini Dibuat Oleh Mr.J")

       if menu == 1 then

          ch1()

        end

       if menu == 2 then

           os.exit()

        end

       if menu == nil then

       else

       end

       menuk = -1

     end

     

     function ch1()

     prompt = gg.prompt({[1]="Nilai Koin Sekarang"}, {}, {"number"}) gg.searchNumber(prompt[1], gg.TYPE_DWORD)

     gg.getResults(100)

     prompt = gg.prompt({[2]="Nilai Koin Sekarang Yang Sudah Berubah"}, {}, {"number"}) gg.refineNumber(prompt[2], gg.TYPE_DWORD)

     gg.getResults(100)

     prompt = gg.prompt({[3]="Nilai Koin Yang Di Inginkan"}, {}, {"number"}) gg.editAll(prompt[3], gg.TYPE_DWORD)

     gg.clearResults()

     gg.toast("Thanks For Using My Script")

     gg.alert("Jangan Buru² Buat Beli, Selesaikan Semua Tutorialnya Dulu Biar Ga Ngebug", "Oke")

     end

     

 

    if menuk == 1 then

       START()

     end

   end

     

     

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.