InterEcrypt Posted August 5, 2018 Posted August 5, 2018 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
CmP Posted August 5, 2018 Posted August 5, 2018 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
InterEcrypt Posted August 5, 2018 Author Posted August 5, 2018 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
CmP Posted August 5, 2018 Posted August 5, 2018 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
HackGamerofc Posted September 7, 2018 Posted September 7, 2018 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
ryuz Posted June 19, 2019 Posted June 19, 2019 you need make a name of alert like po = gg.alert("hack","yes","no") if po == 1 then goto menu end if po == 2 then goto exit end note:number 1 is mean to yes and 2 is no
Question
InterEcrypt
I want the two buttons in gg alert to redirect the user to another place in the example script:
I've already tried
6 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.