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.

Help with looping blocks.

Discussion in 'Skript' started by MasterHunter2003, Jul 21, 2017.

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

    Joined:
    Jan 28, 2017
    Messages:
    23
    Likes Received:
    1
    Hi,
    I've got this code,
    Code (Skript):
    1.  
    2. on place of iron block:
    3.     set {_h} to location of block 5 north of event-block
    4.     set {_h2} to location of block 5 east of {_h}
    5.     set {_xmax} to rounded up x-coordinate of {_h2}
    6.     set {_zmax} to rounded up z-coordinate of {_h2}
    7.     set {_ymax} to 255
    8.     set {_h3} to location at {_xmax}, 255, {_zmax}
    9.     set block at {_h3} to diamond block
    10.     set {_g} to location of block 5 south of event-block
    11.     set {_g2} to location of block 5 west of {_g}
    12.     set {_xmin} to rounded up x-coordinate of {_g2}
    13.     set {_zmin} to rounded up z-coordinate of {_g2}
    14.     set {_ymin} to 0
    15.     set {_h4} to location at {_xmin}, 0, {_zmin}
    16.     set block at {_h4} to diamond block
    17.     loop blocks from {_h3} to {_h4}:
    18.         set {_final} to location of loop-block
    19.         add {_final} to {we.sel.%player%::*}
    20.         add {_final} to {claim.%player%.%{claims.%player%}%::*}
    21.         add {_final} to {claimed.all::*}
    22.         send "%{_final}%"
    23.     send "done"
    24.     add 1 to {claims.%player%}
    25.     set {claim.%player%.%{claims.%player%}%.name} to player
    The problem with this skript is that it doesn't loop through the blocks, any ideas to make this work?
     
  2. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    225
    Code (Skript):
    1. loop blocks within {_h3} to {_h4}:
     
Thread Status:
Not open for further replies.

Share This Page

Loading...