Solved Chest GUI Help

  • 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.

jovanmunja

Member
Jul 27, 2017
22
1
0
I guess this is simple and easy, but I'm a new skript coder!
So.. what I wanna do is, When I open a chest (not on inventory, real chest), I want to open a GUI.. I know what to do next but idk if its:

on right click with chest

or

on chest open

Thats the thing idk. Pls help :emoji_grinning:
[doublepost=1506178759,1506177883][/doublepost]No one?
 
Not tested, but this should work:
code_language.skript:
on right click on chest:
     cancel event
     #open chest command
 
Additional note, if you're using TuSKe (which I really hope you do), you need to wait a tick before opening the inventory. Spigot bug, if you ask.
 
Yeah, @Syst3ms is right. Here is an example if you were confused: (This is for the skQuery chest opening feature, I think.)
code_language.skript:
on right click on chest:
     cancel event
     open chest with 3 rows named "Chest Name Here" to player
     wait 1 tick
     format slot 4 of player with a diamond sword named "Item Name Here" with lore "Your lore here" to close then run "your command here without the /"

So, if you don't have the wait 1 tick like @Syst3ms stated, then the diamond sword or whatever your item is won't appear (In my example, I put it as a diamond sword.)

Again, it is untested so if you have any errors, my apologies as I will help you fix them if you post them here!
 
Status
Not open for further replies.