Jump to content

need help writing a script


 Share

Recommended Posts

I need a code that will minimize it when you click on the cancel button in the script. I have such a code and in fact it works fine, but when you go many times between the various menu sections of which I have a lot in the script, after pressing the cancel button, it’s completely tough, functions that in principle cannot be called from one menu begin to be called to another, so he noticed that after a long transition between menus, the cancel button starts working every other time, that is, I press cancel and the menu starts again and only the second time the menu is hidden. Here is my code please optimize it for me

 

 

while true do
  if gg.isVisible(true) then
    HOMEDM = 1
    gg.setVisible(false)
  end
  if HOMEDM == 1 then
    Test()
  end
end

Link to comment
Share on other sites

i don't understand what you mean, i tried with a piece of code like this, and when i click cancel the menu is always hidden, no matter what menu!

X = {"A","B"}

function A()
	menu = gg.choice(X,nil,"Menu A")
	if menu == 1 then B() end
	if menu == 1 then B() end
	Homedm = -1
end

function B()
	menu = gg.choice(X,nil,"Menu B")
	if menu == 1 then C() end
	if menu == 1 then C() end
	Homedm = -1
end

function C()
	menu = gg.choice(X,nil,"Menu C")
	if menu == 1 then A() end
	if menu == 1 then A() end
	Homedm = -1
end

while true do 
	if gg.isVisible(true) then
    	Homedm = 1
    	gg.setVisible(false)
	end
	if Homedm == 1 then
		A()
	end
end

 

Link to comment
Share on other sites

so weird i didnt notice it before..

what does the "Homedm = -1" do in a function really?

what its relation with this below?

while true do 
	if gg.isVisible(true) then
    	Homedm = 1
    	gg.setVisible(false)
	end
	if Homedm == 1 then
		A()
	end

hope someone more expert can give some insight on this.

@CmP maybe?

Link to comment
Share on other sites

31 minutes ago, Lover1500 said:

We dont understand what you mean too. it will be great if you explains more clear.

This is what i think you need. may be wrong

ok.lua 945 B · 0 downloads

 

hmm..🤔

base on your script...thats probably whats he want.(maybe)

press cancel will hide the script menu but press GG logo again will bring back the menu that you had left before..not the very first menu(main).

he did mention his script had various menu by a lot and so on..so on(parts i dont have clear understand)

Edited by MonkeySAN
Link to comment
Share on other sites

5 hours ago, MonkeySAN said:

what does the "Homedm = -1" do in a function really?

It seems to be some kind of global state variable to control whether main menu should be opened immediately after execution returns to main loop. But more often than not such behavior isn't needed and when it is so, the variable becomes redundant and can be removed. Main loop can be then replaced with the following typical one: 

while true do
  if gg.isVisible()
    gg.setVisible(false)
    Test()
  end
  gg.sleep(100)
end
Link to comment
Share on other sites

2 hours ago, Lover1500 said:

We dont understand what you mean too. it will be great if you explains more clear.

This is what i think you need. may be wrong

ok.lua 945 B · 4 downloads

 

Well, it's not clear, let's take your code, for example, if there are not 3 menus, but for example 30, then this function that hides the script simply will not work, that simply will not work and that's it. I already solved this problem by dropping the code to hide GG under the function.

2 hours ago, Lover1500 said:

Мы тоже не понимаем, что вы имеете в виду. будет здорово, если вы объясните более ясно.

Я думаю, это то, что вам нужно. может ошибаться

ok.lua 945 млрд · 3 загрузки

 

why it would seem that the skins should be executed correctly, but for some reason there are bugs or something else, and the script simply does not see these lines from below that are responsible for hiding gg.

1 hour ago, MonkeySAN said:

Хм..🤔

основываясь на вашем сценарии ... вероятно, это то, что он хочет. (возможно)

нажмите «Отмена», чтобы скрыть меню сценария, но нажмите логотип GG еще раз, чтобы вернуться в меню, которое вы покинули ранее ... не в самое первое меню (главное).

он упомянул, что в его сценарии было много разных меню и так далее ... и так далее (части, которые я не могу четко понять)

I mean what I want, I am very good at writing scripts, well, that is, I am very good at it, but such bugs are just like gg doesn’t read the script correctly.

Link to comment
Share on other sites

6 minutes ago, zolotov123344 said:

Ну непонятно, возьмем ваш код, например, если меню не 3, а например 30, то эта функция, скрывающая скрипт, просто не сработает, просто не сработает и все. Я уже решил эту проблему, сбросив код, скрывающий GG под функцией.

почему могло бы показаться, что скины должны выполняться правильно, но по каким-то причинам есть баги или еще что-то, и скрипт просто не видит эти строки снизу, отвечающие за скрытие gg .

Я имею в виду то, что хочу, я очень хорошо пишу скрипты, ну то есть я очень хорошо это делаю, но такие ошибки такие же, как gg не читает скрипт правильно.

google translate translates my text disgustingly

Link to comment
Share on other sites

2 hours ago, zolotov123344 said:

google translate translates my text disgustingly

yup..Google Translate can be such an idiot sometime.

im still had no idea what are you try to tell us..plus my english wasnt that good either.

but is your problem solved now?

Edited by MonkeySAN
Link to comment
Share on other sites

On 11/27/2021 at 1:32 AM, zolotov123344 said:

I need a code that will minimize it when you click on the cancel button in the script. I have such a code and in fact it works fine, but when you go many times between the various menu sections of which I have a lot in the script, after pressing the cancel button, it’s completely tough, functions that in principle cannot be called from one menu begin to be called to another, so he noticed that after a long transition between menus, the cancel button starts working every other time, that is, I press cancel and the menu starts again and only the second time the menu is hidden. Here is my code please optimize it for me

 

 

while true do
  if gg.isVisible(true) then
    HOMEDM = 1
    gg.setVisible(false)
  end
  if HOMEDM == 1 then
    Test()
  end
end

Use return.

Link to comment
Share on other sites

10 hours ago, MonkeySAN said:

ага .. Google Translate может быть таким идиотом когда-нибудь.

Я все еще понятия не имел, что ты пытаешься нам сказать ... плюс мой английский тоже был не так хорош.

но теперь твоя проблема решена?

yes

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

  • Similar Content

    • By GRANDALoST
      View File Hide Online GRANDALoST V0.0
      🇧🇷Br version:  Este hack foi feito por GRANDALoST! O hack tem as seguintes funções:
      🇺🇸Us version: This hack was made by GRANDALoST!  The hack has the following options:
      Teleport (Teleporte)
      Open FBI door (Abrir porta dos cassadores)
      Go to spawn (Voltar daonde comessou)
      Speed hack (Virar Frash)
      Vip options (opções Vip)
      Wall Hack
      Block ads (Tirar anúncios)
      Camera (câmera)
      Easy mode (modo fácil)
      Auto Gun+god mode+bug (arma automatica+vida infinita+bug)
      Back (SAIR)
      🇧🇷---Mod menu V0.0 ALGUMAS OPÇÕES PODEM NAO FUNCIONAR!!
      🇺🇸---Mod menu V0.0 SOME OPTIONS MAY NOT WORK!!
      Submitter GRANDALoST Submitted 01/15/2022 Category LUA scripts  
    • By YahyaN
      Pᴀssᴡᴏʀᴅ :666
       
      ᴄ++ .ʙss
       
      Fᴇᴀᴛᴜʀᴇs :
      ᴄʜᴀɴɢᴇ ᴀʟʟ ᴘʀɪᴄᴇs ᴛᴏ 0
      ᴛʜᴇ sᴄʀɪᴘᴛ ᴍᴀʏ ɴᴏᴛ ʀᴜɴ ᴏɴ sᴏᴍᴇ ᴅᴇᴠɪᴄᴇs
    • By YahyaN
      View File Script Robbery Bob |
      Pᴀssᴡᴏʀᴅ :666
       
      ᴄ++ .ʙss
       
      Fᴇᴀᴛᴜʀᴇs :
       
      ᴄʜᴀɴɢᴇ ᴀʟʟ ᴘʀɪᴄᴇs ᴛᴏ 0
      Submitter YahyaN Submitted 01/18/2022 Category LUA scripts  
    • By Lucky_Brill
      Hi, I have been using a script for "Sky Children of the Light" called: *****CHINA_Full.lua* for a few months now, but sadly since the last update it stopped working. When I run it, it says that the script needs to be updated. I would be grateful if someone with programming knowledge could update it for me or at least share some other script to farm all the worlds. (I attach the script and the text that appears when I run it)


      ****CHINA_Full.lua.txt
    • By pro_ejder
      + Telegram'daki Tüm Komut Dosyalarına Erişin:   https://t.me/SktirAndroidHile
      CATS: Crash Arena Turbo Stars God Mode Vers. 2.41 Mod 👇
      +MOD APK DOWNLOAD : https://t.me/SktirAndroidHile/63
       
       
×
×
  • 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.