Tutorial by: Olyno


Good morning, everybody! Today, I'll tell you how to make guis with tuske.

How does TuSke GUI work?

TuSke GUIs are very similar to SkQuery GUIs in their composition:

open (virtual %inventory type% inventory [with size %integer%] [(named|with (name|title)) %string%]) to %players%

Many people are not going to understand this code, so we will translate it:

Open a virtual inventory with a size of X lines named Y to the player.

Now that we have our inventory, we're going to put things in it:

(format|create|make) [a] gui slot %numbers% of %players% with %itemstack% to [do] nothing
(format|create|make) [a] gui slot %numbers% of %players% with %itemstack% to close [using %click action% [(button|click|action)]]
(format|create|make) [a] gui slot %numbers% of %players% with %itemstack% to [close then] run %command sender% command %string% [as op] [using %click action% [(button|click|action)]] [with cursor [item] %itemstack%]
(format|create|make) [a] gui slot %numbers% of %players% with %itemstack% to [close then] run function %function% [using %click action% [(button|click|action)]] [with cursor [item] %itemstack%]

This is all the possibilities for adding items to the inventory.
To understand a little better, tell you what:

| : Wants to say "or" .

[a]... : Is not obligatory.

%number% : Is the slot of the item.

%players% : Is the player/a player

%itemstack% : Is the item.

%command sender% : Is the person/player/console executing the command

%click action% : Is the click used

%function% : Executes a function

%string% : Is the command

Well, I hope you've already managed to figure out what was the hardest part.
Using this addon a lot, I was able to test the different ways of using it. We will now see which are the best "options".

What are the best "options"?

When I talk about "options", I am of course talking about "or" and "%string%, %function%, %click share%, %click%...
Well.
The "option" to use to put an item, the best, is this one:

format gui slot %numbers% of %players% with %itemstack% to [do] nothing

The "to [do] nothing" can be modified.

Why didn't I choose "create or "make"? Simply because these two "options" make your server paddle too much. The average time of a skript reload with these two "options" is 20 seconds to 1 minute while with "format", the time is not 5 seconds (I let you test by yourself).

What is the translation of all these "options"?

First of all, we will display the GUI and explain the functionalities of each one:

open virtual chest inventory with size X named "Y" to player
format gui slot %numbers% of %players% with %itemstack% to [do] nothing

Displays a GUI to the player's "%numbers%" slot with the item "%itemstack%" that does not move when clicked.

format gui slot %numbers% of %players% with %itemstack% to close [using %click action%]

Displays a GUI to the player's %numbers% slot with the item "%itemstack%" that closes when you click on it (and can be feminized with a particular click as right, left click... (using %click action%)).

format gui slot %numbers% of %players% with %itemstack% to run %command sender% command %string%

Displays a GUI to the player's "%numbers%" slot with the item "%itemstack%" that executes a command when clicked.

format gui slot %numbers% of %players% with %itemstack% to close then run %command sender% command %string% [as op] [using %click action% [(button|click|action)]] [with cursor [item] %itemstack%]

Displays a GUI to the player's %numbers% slot with the item "%itemstack%" that closes and executes a command when clicking on it ([as op] = is op;[with cursor[item] %itemstack%] = with the cursor on the item "%itemstack%").

format gui slot %numbers% of %players% with %itemstack% to close then run function %function%

Displays a GUI to the player's %numbers% slot with the item "%itemstack%" that closes and executes a function when clicked.

What are clicks events for?

Click events allow you to make several effects with only 1 item in the virtual inventory.
Example: An iron block: Right click, it sends a message to the player. We're doing a left-hand clique, he's doing a broadcast.

format gui slot 1 of player with Iron Block to close then run player command "/broadcast" with left click
format gui slot 1 of player with Iron Block to close then run player command "/send" with right click

Do you understand the idea?

Here is a simple example:

open virtual chest inventory with size 1 named "This menu is a test" to player
format gui slot 4 of player with diamond sword named "The name of my object" to close then run player command "/macommande"

For functions, it is the same idea:

open virtual chest inventory with size 1 named "This menu is a test" to player
format gui slot 4 of player with diamond sword named "The name of my object" to run function MyFunction(player, "Blablabla")

To use the clicks, you will have to create the same item several times but with a different effect:

open virtual chest inventory with size 1 named "This menu is a test" to player
format gui slot 4 of player with diamond sword named "The name of my object" to run function MyFunction(player, "Blablabla") with "right" click
format gui slot 4 of player with diamond sword named "The name of my object" to run function MySecondFunction(player, "Blablabla") with "left" click

Well, you can also execute several effects from a slot like this:

open virtual chest inventory with size 1 named "This menu is a test" to player
format gui slot 4 of player with diamond sword named "The name of my object" to run:
    set {_myvariable} to 4
    send "Omg, it's the slot %{_myvariable}%!"

Hopefully this little tutorial will get you more.


Did you find Olyno's tutorial helpful?


You must be logged in to comment

  • April 22, 2019, 3:40 p.m. - ronaldgameking  

    Wow, how did this get approved? It has so many mistakes and you are only mentioning SkQuery GUI's which are trash.

    | 3     
    April 22, 2019, 3:40 p.m. - ronaldgameking  

    EDIT: mostly SkQuery menus

    | 2     
    June 18, 2019, 6:04 p.m. - ShaneBee  

    This tutorial has nothing to do with SkQuery
    SkQuery = format slot 1
    Tuske = format gui slot 1

    I recommend knowing the different before leaving a comment like this.

    2 |     
    July 20, 2019, 12:46 p.m. - ronaldgameking  

    not that, this
    open (virtual %inventory type% inventory [with size %integer%] [(named|with (name|title)) %string%]) to %players%

    | 1     
    Aug. 26, 2019, 6:27 p.m. - Criticyl  

    Thats still TuSKe GUI's, skQuery uses "open chest with x rows named "name" to player"

    1 |
  • July 4, 2020, 7:14 p.m. - Zain  

    Yo this was super helpful and easy to understand, thanks a ton!

    |     
  • Sept. 11, 2020, 8:39 a.m. - chuxia1123  

    can you help me

    |     
  • Sept. 11, 2020, 8:40 a.m. - chuxia1123  

    |     
  • Sept. 11, 2020, 8:41 a.m. - chuxia1123  

    |     
  • March 11, 2022, 4:51 p.m. - Gab  

    If you have TuSKe installed uninstall it, most of the time it causes skripts to break

    |     
  • Feb. 8, 2024, 4:52 p.m. - dj_dogos  

    I tryed to make GUI with TuSKe and it broke the skript plugin

    |