1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

What's wrong with this script?

Discussion in 'Skript' started by TheCringleYT, Nov 20, 2021.

Thread Status:
Not open for further replies.
  1. TheCringleYT

    TheCringleYT Active Member

    Joined:
    Sep 29, 2019
    Messages:
    194
    Likes Received:
    4
    Sorry, title's wrong!

    How do I make it so when I right click on a certain chest (for example one at 100, 0, 190 from coordinates) it opens a gui, but when i right click a chest not there its a normal one
     
    #1 TheCringleYT, Nov 20, 2021
    Last edited: Nov 20, 2021
  2. Kunkar1337

    Kunkar1337 Member

    Joined:
    Nov 23, 2021
    Messages:
    1
    Likes Received:
    0
    Hello.

    Can you send me your gui and coordinates of a chest? You just have to check the event block coordinates when player is right clicking. Its not that hard.

    EDIT: With event block i mean target block.
    --- Double Post Merged, Nov 23, 2021, Original Post Date: Nov 23, 2021 ---
    For example:

    on right-click: #on only right click event.
    if location of target block is location at 100.5, 0.5, 190.5 of the world "world": #Checks target block coordinates in world "world".
    cancel event
    make player execute "/yourguicommandhere" #opens the gui.
    --- Double Post Merged, Nov 23, 2021 ---
    @TheCringleYT
     
  3. Phuple

    Phuple Member

    Joined:
    Jun 25, 2021
    Messages:
    18
    Likes Received:
    1
    As
    As said above you can just check for the coords and then do as followed, but there are better methods (Assuming your new to skript), instead of checking the coords you can just check the name of the event-block

    If youre not new then you could do
    Code (Text):
    1.  
    2. on right click:
    3.    if location of event-block = location(0, 0, 0, player's world): # (if name of event-block = "name") to check the name I think
    4.        #Here you could call for a function instead of executing a command or simply just create the inventory here
    5.  
     
Thread Status:
Not open for further replies.

Share This Page

Loading...