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.

Solved checking above player has a block

Discussion in 'Skript' started by BrownMee, Feb 17, 2021.

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

    BrownMee Active Member

    Joined:
    Apr 16, 2018
    Messages:
    126
    Likes Received:
    6
    I'm not sure how to check for player is in house or outside a house.. please help
    --- Double Post Merged, Feb 18, 2021, Original Post Date: Feb 17, 2021 ---
    bump
     
  2. Best Answer:
    Post #2 by Nikd0, Feb 19, 2021
  3. Nikd0

    Nikd0 Active Member

    Joined:
    May 30, 2020
    Messages:
    208
    Likes Received:
    21
    Code (Text):
    1. set {_x} to x-coordinate of location of player
    2. set {_y} to y-coordinate of location of player
    3. set {_z} to z-coordinate of location of player
    4. loop 10 times:
    5.     add 1 to {_y}
    6.     if block at location {_x}, {_y}, {_z} != air:
    7.         add 1 to {_blocks}
    8. if {_blocks} > 0:
    9.     send "There are blocks above the player! He/She may be in a house"
    Note: I did not test this, there may be a mistake - but the idea should be right
     
Thread Status:
Not open for further replies.

Share This Page

Loading...