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.

How to check if a door is open

Discussion in 'Skript' started by NivekGnal, Jun 20, 2022.

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

    NivekGnal Member

    Joined:
    Jun 20, 2022
    Messages:
    4
    Likes Received:
    0
    I have been searching for the last hours on how to check if a door is open at a specific location have not found anything yet.

    Version: 1.16.2 Paper
     
  2. Jake*

    Supporter

    Joined:
    Jan 30, 2022
    Messages:
    109
    Likes Received:
    6
    Code (Text):
    1. oak_door[open=false]
    it can be either false or true
     
  3. NivekGnal

    NivekGnal Member

    Joined:
    Jun 20, 2022
    Messages:
    4
    Likes Received:
    0
    But how to check this in an if statement like
    Code (Text):
    1. if iron door[open=false] at location(-24.5, 4, -253.5, world):
     
  4. Jake*

    Supporter

    Joined:
    Jan 30, 2022
    Messages:
    109
    Likes Received:
    6
    block data, what you just sent makes 0 sense
     
  5. SWOEN

    SWOEN Member

    Joined:
    Apr 26, 2022
    Messages:
    12
    Likes Received:
    0
    I just found this on the forums:


    Code (Text):
    1.  
    2. if target block of player is door:
    3.         set {_block} to "%target block of player%"
    4.         if {_block} contains "open":
    5.                 send "[Debug] The door you're looking at is open." to player
    6.     else:
    7.         send "[Debug] The door you're looking at is closed." to player

    You could change it to:

    Code (Text):
    1. if block at location(location) is a door:
    2.   set {_block} to event-block
    3.   if {_block} contains "open":
    4.     do stuff
    5.   else:
    6.      do other stuff
     
  6. NivekGnal

    NivekGnal Member

    Joined:
    Jun 20, 2022
    Messages:
    4
    Likes Received:
    0
    This is not working right now i have
    Code (Text):
    1.  
    2. command /doorgui:
    3.     trigger:
    4.         open chest with 3 rows named "&3DOOR GUI" to player
    5.         if block at location(-24.5, 4, -253.5, world) is a door:
    6.             set {_block1} to event-block
    7.             if {_block1} contains "open":
    8.                 format slot 0 of player with green wool named "&rTest Door" to close then run "door1"
    9.             else:
    10.                 format slot 0 of player with red wool named "&rTest Door" to close then run "door1"
    It will always show the red wool
     
  7. SWOEN

    SWOEN Member

    Joined:
    Apr 26, 2022
    Messages:
    12
    Likes Received:
    0

    Do you have SkQuery installed? With the right version? (Matching your Skript version)
     
  8. NivekGnal

    NivekGnal Member

    Joined:
    Jun 20, 2022
    Messages:
    4
    Likes Received:
    0
    Yes i have sorry for the late reaction
     
Thread Status:
Not open for further replies.

Share This Page

Loading...