Solved Check doublechest

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

SoMuchWessel

Active Member
Apr 3, 2017
147
3
18
46
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_language.skript:
command /chest:
    permission: fill.chests
    permission message: &aDenied.
    trigger:
        if targeted block is a chest:
            loop all blocks in radius 1 around targeted block:
                if loop-block is a chest:
                    clear targeted block's inventory
                     add {chest::items} to targeted block's inventory
                     send "&aLoot added!"
                else:
                    send "&aThis is not a doublechest!"

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?
 
code_language.skript:
if block at location 1 meter to the right of targeted block is chest:
    #STUFF
if block at location 1 meter to the left of targeted block is chest:
    #STUFF
 
Status
Not open for further replies.