GUI/Keybind Issue

Started by The Typholorian on

Topic category: Help with modding (Java Edition)

Last seen on 18:46, 8. Sep 2023
Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
GUI/Keybind Issue

Making a new GUI that opens when a button is pressed. I got it to work (mostly), but every time you press the button it opens and closes almost instantly. I added chat messages to help with debugging. Here's the code (had to type it):

 

Set [Local: Disabler] to: (false);

If (GUI open AND [Local: Disabler] = (false) {

Send chat to all players: {close};

Close any GUI open for (Event/target entity);

Set [Local: Disabler] to: (true);

}

If (GUI not open AND [Local: Disabler] = (false) {

Send chat to all players: {open};

Open the GUI;

Set [Local: Disabler] to: (true);

}