need help with chest 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 community!

    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.

wilsonisgay

Member
Mar 30, 2022
2
0
1
I'm making a chest gui that clears the inventory of the player when they click on a green wool after executing a command

I'm relatively new to skript, but i've figured out the command that opens a chest
I'm stuck on the part where after they click a certain block, it clears the player's inventory or closes the gui
any tips?

name for the skript file is shop but contains the skript for the clear inventory
 

Attachments

  • shop.sk
    2.9 KB · Views: 272
I'm making a chest gui that clears the inventory of the player when they click on a green wool after executing a command

I'm relatively new to skript, but i've figured out the command that opens a chest
I'm stuck on the part where after they click a certain block, it clears the player's inventory or closes the gui
any tips?

name for the skript file is shop but contains the skript for the clear inventory
Follow this tutorial https://forums.skunity.com/threads/vanilla-guis.8939/
[doublepost=1648675223,1648666012][/doublepost]
I'm making a chest gui that clears the inventory of the player when they click on a green wool after executing a command

I'm relatively new to skript, but i've figured out the command that opens a chest
I'm stuck on the part where after they click a certain block, it clears the player's inventory or closes the gui
any tips?

name for the skript file is shop but contains the skript for the clear inventory
Code:
command /clearGUI:
    trigger:
        open chest inventory with 1 rows named "&cClear your inventory." to player
        set slot 4 of player's current inventory to lime wool named "&6Clear inventory"
 
on inventory click:
    #check if the clicked inventory is the one we just created
    if name of event-inventory is "&cClear your inventory.":
        #cancel the clicking. This makes the Item unstealable
        cancel event
        clear the player's inventory
 
didn't work
error message said that line 3 wasnt an entity type
line 4 wasnt an item type
and line 8 wasnt an entity
 
you might need skquery for this to work

Code:
command /clearGUI:
    trigger:
        wait tick
        open chest with 1 rows named "&cClear your inventory." to player
        format slot 4 of player with lime wool named "&6Clear inventory" to close then run [make console execute command "/clear %player%"]
 
Status
Not open for further replies.