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 block below player

Discussion in 'Skript' started by PanHack, Apr 10, 2020.

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

    PanHack Active Member

    Joined:
    Dec 18, 2019
    Messages:
    143
    Likes Received:
    8
    Hi i want a script that trapes you in 2x1 cage made of glass [​IMG]
    But if block under is not air it wouldn't set it to glass
    screenshot: https://imgur.com/a/OxgsKYd

    Current code
    Code (Text):
    1. command /@101 <player>:
    2.     trigger:
    3.         set block north above the player to glass
    4.         set block east above the player to glass
    5.         set block south above the player to glass
    6.         set block west above the player to glass
    7.         set block 2 meters above the player to glass
    8.         set block north the player to glass
    9.         set block east the player to glass
    10.         set block south the player to glass
    11.         set block west the player to glass
    12.         set block below the player to glass
    13.         wait 5 seconds
    14.         set block north above the player to air
    15.         set block east above the player to air
    16.         set block south above the player to air
    17.         set block west above the player to air
    18.         set block 2 meters above the player to air
    19.         set block below the player to air
    20.         set block north the player to air
    21.         set block east the player to air
    22.         set block south the player to air
    23.         set block west the player to air


     
  2. Best Answer:
    Post #11 by PanHack, Apr 10, 2020
  3. HiqqhFive

    Supporter

    Joined:
    Jan 28, 2017
    Messages:
    60
    Likes Received:
    6
    Hey, try this instead of "block below the player":

    Code (Text):
    1. %block under player%
     
  4. PanHack

    PanHack Active Member

    Joined:
    Dec 18, 2019
    Messages:
    143
    Likes Received:
    8
    can you send code please im kinda busy ...
     
  5. HiqqhFive

    Supporter

    Joined:
    Jan 28, 2017
    Messages:
    60
    Likes Received:
    6
    Yes of course.

    Code (Text):
    1. command /@101 <player>:
    2.     trigger:
    3.         set block north above the player to glass
    4.         set block east above the player to glass
    5.         set block south above the player to glass
    6.         set block west above the player to glass
    7.         set block 2 meters above the player to glass
    8.         set block north the player to glass
    9.         set block east the player to glass
    10.         set block south the player to glass
    11.         set block west the player to glass
    12.         set block under the player to glass
    13.         wait 5 seconds
    14.         set block north above the player to air
    15.         set block east above the player to air
    16.         set block south above the player to air
    17.         set block west above the player to air
    18.         set block 2 meters above the player to air
    19.         set block under the player to air
    20.         set block north the player to air
    21.         set block east the player to air
    22.         set block south the player to air
    23.         set block west the player to air
     
  6. PanHack

    PanHack Active Member

    Joined:
    Dec 18, 2019
    Messages:
    143
    Likes Received:
    8
    i dont see any change in code
     
  7. HiqqhFive

    Supporter

    Joined:
    Jan 28, 2017
    Messages:
    60
    Likes Received:
    6
    Look at this:
    I replaced "below" with "UNDER"
     
  8. PanHack

    PanHack Active Member

    Joined:
    Dec 18, 2019
    Messages:
    143
    Likes Received:
    8
    oh but i dont mean that. I mean checking block below if it's air or not , if is change it to glass
     
  9. HiqqhFive

    Supporter

    Joined:
    Jan 28, 2017
    Messages:
    60
    Likes Received:
    6
    This code:

    Code (Text):
    1. command /test:
    2.   trigger:
    3.     block under player is air:
    4.       set block under the player to glass
    5.     else:
    6.       set block under the player to air
    7.  
     
  10. PanHack

    PanHack Active Member

    Joined:
    Dec 18, 2019
    Messages:
    143
    Likes Received:
    8
    and how do i paste that code mine code ?
     
  11. HiqqhFive

    Supporter

    Joined:
    Jan 28, 2017
    Messages:
    60
    Likes Received:
    6
    As an an example:

    Code (Text):
    1. command /@101 <player>:
    2.     trigger:
    3.         set block north above the player to glass
    4.         set block east above the player to glass
    5.         set block south above the player to glass
    6.         set block west above the player to glass
    7.         set block 2 meters above the player to glass
    8.         set block north the player to glass
    9.         set block east the player to glass
    10.         set block south the player to glass
    11.         set block west the player to glass
    12.         block under player is air:
    13.             set block under the player to glass
    14.         else:
    15.             set block under the player to air
    16.  
    17.         set block under the player to glass
    18.         wait 5 seconds
    19.         set block north above the player to air
    20.         set block east above the player to air
    21.         set block south above the player to air
    22.         set block west above the player to air
    23.         set block 2 meters above the player to air
    24.         set block north the player to air
    25.         set block east the player to air
    26.         set block south the player to air
    27.         set block west the player to air
    28.         block under player is air:
    29.             set block under the player to glass
    30.         else:
    31.             set block under the player to air
     
    • Like Like x 1
  12. PanHack

    PanHack Active Member

    Joined:
    Dec 18, 2019
    Messages:
    143
    Likes Received:
    8
    ok i got it right way
    Code (Text):
    1. command /@101 <player>:
    2.     trigger:
    3.         set block north above the player to glass
    4.         set block east above the player to glass
    5.         set block south above the player to glass
    6.         set block west above the player to glass
    7.         set block 2 meters above the player to glass
    8.         set block north the player to glass
    9.         set block east the player to glass
    10.         set block south the player to glass
    11.         set block west the player to glass
    12.         block under player is air:
    13.             set block under the player to glass
    14.    
    15.         wait 5 seconds
    16.         set block north above the player to air
    17.         set block east above the player to air
    18.         set block south above the player to air
    19.         set block west above the player to air
    20.         set block 2 meters above the player to air
    21.         set block north the player to air
    22.         set block east the player to air
    23.         set block south the player to air
    24.         set block west the player to air
    25.         block under player is glass:
    26.             set block under the player to air
     
Thread Status:
Not open for further replies.

Share This Page

Loading...