Solved GUI

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

ChocoAura

Member
Jul 3, 2019
38
0
6
24
So for future reference, I would like to learn how to create a GUI using Skript. Could someone show me?
 
So for future reference, I would like to learn how to create a GUI using Skript. Could someone show me?
If you mean "create a GUI using Skript" not to use any addon, I think this would work:
code_language.skript:
open chest inventory with [number of lines] row[add a 's' if the amount is more than 1] named "gui name" to player
set slot [slot number] of player's current inventory to [item] named "item name"
And then if you want to add an effect to the block, then you do this:
(For example)
code_language.skript:
command /warp [<string>]:
    trigger:
        arg 1 is not set:
            open chest inventory with 3 rows named "Warps" to player
            set slot 10 of player's current inventory to diamond pickaxe named "&6Warp MinePvP"
    
on inventory click:
    clicked inventory isn't player's inventory
    if inventory name of player's current inventory is "Warps":
        if clicked slot = 10:
            player command "warp minepvp
I have not used this type of code for a long time, but try it if you want.
 
If you mean "create a GUI using Skript" not to use any addon, I think this would work:
code_language.skript:
open chest inventory with [number of lines] row[add a 's' if the amount is more than 1] named "gui name" to player
set slot [slot number] of player's current inventory to [item] named "item name"
And then if you want to add an effect to the block, then you do this:
(For example)
code_language.skript:
command /warp [<string>]:
    trigger:
        arg 1 is not set:
            open chest inventory with 3 rows named "Warps" to player
            set slot 10 of player's current inventory to diamond pickaxe named "&6Warp MinePvP"
   
on inventory click:
    clicked inventory isn't player's inventory
    if inventory name of player's current inventory is "Warps":
        if clicked slot = 10:
            player command "warp minepvp
I have not used this type of code for a long time, but try it if you want.
Is there a way to close the inventory and open a new one?
 
Is there a way to close the inventory and open a new one?
Code:
trigger:
    close inventory of player
    wait 1 tick
    open chest inventory with 3 rows named "new gui" to player

or

Code:
if clicked slot = 10:
    close inventory of player
    wait 1 tick
    execute player command "opengui"

command /opengui:
    trigger:
        open chest inventory with 3 rows named "new gui" to player
 
Status
Not open for further replies.