Jump to content
  • 0

Help me fast plzz gg alert


InterEcrypt

Question

I want the two buttons in gg alert to redirect the user to another place in the example script:

I've already tried

gg.alert ("Hack", "Go?", "No")
If menu == 1 then goto script end
if menu == 2 then goto start
 
But it does not work, somebody help me fast I have to post this script soon thanks: D

Screenshot_20180805-195728.png

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

Well, you forgot to store the value that is returned by gg.alert function.

Example of correct usage of alert function for your case:

local menu = gg.alert('Hack', 'Go?', 'No')
if menu == 0 then -- User can cancel alert window by pressing "back" button
  -- Actions, if user cancelled the window
elseif menu == 1 then
  -- Actions, if user pressed "Go?"
elseif menu == 2 then
  -- Actions, if user pressed "No"
end

 

Link to comment
Share on other sites

When I put this command

menu = gg.alert ("HAVE PASS DIAMOND AND GET TESTER BETA, YOUR NAME IN THE MURAL, HAVE ACCESS TO EXCLUSIVE HACKS, ETC ...", "I Want to See More!", "Maybe Later!")
if menu == 1 then goto START end
if menu == 2 then goto pass end
 
The two options goes to the same place "start" helps me

 

Link to comment
Share on other sites

12 minutes ago, InterEcrypt said:

The two options goes to the same place "start" helps me

I would suggest you not using "goto" where it is not critically required, but if you want your script to be a mess of jumps to different places in the code that is hard to debug, then it is your choice. If both of those options perform a jump to the same place, then likely you made mistakes in declaration of labels for goto operator. Show the code, where the labels are declared, if you want someone to be able to find possible mistakes in it.

Also check lua reference manual for more information about goto operator and labels: 
https://www.lua.org/manual/5.3/manual.html#3.3.4

Link to comment
Share on other sites

When I put the error

On 8/5/2018 at 8:15 PM, CmP said:

Well, you forgot to store the value that is returned by gg.alert function.

Example of correct usage of alert function for your case:


local menu = gg.alert('Hack', 'Go?', 'No')
if menu == 0 then -- User can cancel alert window by pressing "back" button
  -- Actions, if user cancelled the window
elseif menu == 1 then
  -- Actions, if user pressed "Go?"
elseif menu == 2 then
  -- Actions, if user pressed "No"
end

 

 

Screenshot_2018-09-07-15-10-15.png

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.