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

Solved Check doublechest

Discussion in 'Skript' started by SoMuchWessel, Apr 25, 2018.

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

    SoMuchWessel Well-Known Member

    Joined:
    Apr 3, 2017
    Messages:
    135
    Likes Received:
    2
    Hey guys,

    I want to write a code that if i run a command like /chest, that it checks if the chest is a double chest.
    This is the piece of code that i have:


    Code (Skript):
    1.  
    2. command /chest:
    3.     permission: fill.chests
    4.     permission message: &aDenied.
    5.     trigger:
    6.         if targeted block is a chest:
    7.             loop all blocks in radius 1 around targeted block:
    8.                 if loop-block is a chest:
    9.                     clear targeted block's inventory
    10.                      add {chest::items} to targeted block's inventory
    11.                      send "&aLoot added!"
    12.                 else:
    13.                     send "&aThis is not a doublechest!"
    14.  
    15.  
    But this code doesn't seem to work, because if i put one chest down, it also sees it that if there is a chest next to is.
    Also it spams the else message a lot, which i also do not want.


    Can you guys help?
     
  2. Best Answer:
    Post #2 by JustADev, Apr 25, 2018
  3. JustADev

    JustADev Well-Known Member

    Joined:
    Apr 8, 2017
    Messages:
    380
    Likes Received:
    9
    Code (Skript):
    1. if block at location 1 meter to the right of targeted block is chest:
    2.     #STUFF
    3. if block at location 1 meter to the left of targeted block is chest:
    4.     #STUFF
     
  4. SoMuchWessel

    SoMuchWessel Well-Known Member

    Joined:
    Apr 3, 2017
    Messages:
    135
    Likes Received:
    2
    Thanks!
     
Thread Status:
Not open for further replies.
Loading...