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.

Create block radius around player

Discussion in 'Skript' started by Ariuw, Sep 15, 2021.

  1. Ariuw

    Ariuw Member

    Joined:
    Sep 6, 2017
    Messages:
    40
    Likes Received:
    0
    Hello there, I've been trying to do a block radius around player when the player right clicks on a stick but I can't get it to work this is what I have so far:

    Code (Text):
    1.  
    2. on right click with stick:
    3.         create a fake explosion at event-location
    4.         loop all blocks in radius 6 around player:
    5.             y coordinate of loop-block is y coordinate of player:
    6.                 set loop-block to diamond block
    7.                 wait 1 second
    8.                 set loop-block to air
    9.  
    This will do nothing, it will just do the fake explosion.. any ideas?

    This is what I want:
    [​IMG]
     
  2. oToghty

    VIP Supporter +

    Joined:
    Sep 1, 2020
    Messages:
    39
    Likes Received:
    2
    Debug it, broadcast the y-coord, I'm pretty sure blocks have .5 at the end of each coord
     
  3. Ariuw

    Ariuw Member

    Joined:
    Sep 6, 2017
    Messages:
    40
    Likes Received:
    0
    Yeah, it's .5 but I don't know how to fix it then, like what should I do to fix it then?
     
  4. oToghty

    VIP Supporter +

    Joined:
    Sep 1, 2020
    Messages:
    39
    Likes Received:
    2
    Basically just do
    y-loc of player's location is (y-loc of loop-block's location + 0.5) or 0.5, depending if it go up or down
     
  5. TheCubPlays

    TheCubPlays Member

    Joined:
    Jun 22, 2021
    Messages:
    33
    Likes Received:
    3
    I don't think that the issue is the block's y cord since I've done such a thing before, I'm not sure what the issue is though either..maybe try this? That's the way I'd do it:

    Code (Text):
    1. on right click with stick:
    2.         create a fake explosion at event-location
    3.         set {_y} to y coordinate of player's location
    4.         loop all blocks in radius 6 around player:
    5.                 if y coordinate of loop-block is {_y}:
    6.                         set loop-block to diamond block
    7.                         wait 1 second
    8.                         set loop-block to air
    Like maybe the issue is the way you get the y coordinate instead?
     

Share This Page

Loading...