Solved Checking block below player

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

PanHack

Active Member
Dec 18, 2019
143
8
18
24
Hi i want a script that trapes you in 2x1 cage made of glass
OxgsKYd

But if block under is not air it wouldn't set it to glass
screenshot: https://imgur.com/a/OxgsKYd

Current code
Code:
command /@101 <player>:
    trigger:
        set block north above the player to glass
        set block east above the player to glass
        set block south above the player to glass
        set block west above the player to glass
        set block 2 meters above the player to glass
        set block north the player to glass
        set block east the player to glass
        set block south the player to glass
        set block west the player to glass
        set block below the player to glass
        wait 5 seconds
        set block north above the player to air
        set block east above the player to air
        set block south above the player to air
        set block west above the player to air
        set block 2 meters above the player to air
        set block below the player to air
        set block north the player to air
        set block east the player to air
        set block south the player to air
        set block west the player to air
 
Yes of course.

Code:
command /@101 <player>:
    trigger:
        set block north above the player to glass
        set block east above the player to glass
        set block south above the player to glass
        set block west above the player to glass
        set block 2 meters above the player to glass
        set block north the player to glass
        set block east the player to glass
        set block south the player to glass
        set block west the player to glass
        set block under the player to glass
        wait 5 seconds
        set block north above the player to air
        set block east above the player to air
        set block south above the player to air
        set block west above the player to air
        set block 2 meters above the player to air
        set block under the player to air
        set block north the player to air
        set block east the player to air
        set block south the player to air
        set block west the player to air
 
oh but i dont mean that. I mean checking block below if it's air or not , if is change it to glass
 
This code:

Code:
command /test:
  trigger:
    block under player is air:
      set block under the player to glass
    else:
      set block under the player to air
 
As an an example:

Code:
command /@101 <player>:
    trigger:
        set block north above the player to glass
        set block east above the player to glass
        set block south above the player to glass
        set block west above the player to glass
        set block 2 meters above the player to glass
        set block north the player to glass
        set block east the player to glass
        set block south the player to glass
        set block west the player to glass
        block under player is air:
            set block under the player to glass
        else:
            set block under the player to air

        set block under the player to glass
        wait 5 seconds
        set block north above the player to air
        set block east above the player to air
        set block south above the player to air
        set block west above the player to air
        set block 2 meters above the player to air
        set block north the player to air
        set block east the player to air
        set block south the player to air
        set block west the player to air
        block under player is air:
            set block under the player to glass
        else:
            set block under the player to air
 
  • Like
Reactions: PanHack
ok i got it right way
Code:
command /@101 <player>:
    trigger:
        set block north above the player to glass
        set block east above the player to glass
        set block south above the player to glass
        set block west above the player to glass
        set block 2 meters above the player to glass
        set block north the player to glass
        set block east the player to glass
        set block south the player to glass
        set block west the player to glass
        block under player is air:
            set block under the player to glass
    
        wait 5 seconds
        set block north above the player to air
        set block east above the player to air
        set block south above the player to air
        set block west above the player to air
        set block 2 meters above the player to air
        set block north the player to air
        set block east the player to air
        set block south the player to air
        set block west the player to air
        block under player is glass:
            set block under the player to air
 
Status
Not open for further replies.