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 Trying to set blocks in an area between 2 points

Discussion in 'Skript' started by Natalciuu, Oct 14, 2021.

Tags:
  1. Natalciuu

    Natalciuu Member

    Joined:
    Nov 12, 2020
    Messages:
    20
    Likes Received:
    0
    Im trying to build a prison skript from the ground up and ive run into an issue with reseting the mines. I cannot get them to set the blocks in the entire area. It creates a line of blocks inbetween instead of making it fill the entire area.

    My Code for it:
    Code (Text):
    1. every 10 seconds in world "Prison":
    2.     loop {mines.name::*}:
    3.         loop all blocks from {minespos1.%loop-value%} to {minespos2.%loop-value%}:
    4.             set {_block} to random element of {mines::%loop-value-1%::panel::*}
    5.             set block at loop-block to {_block}
     
  2. oToghty

    VIP Supporter +

    Joined:
    Sep 1, 2020
    Messages:
    142
    Likes Received:
    5
    Code (Text):
    1. set all blocks within {} and {} to random element out of {}
     
  3. Natalciuu

    Natalciuu Member

    Joined:
    Nov 12, 2020
    Messages:
    20
    Likes Received:
    0
    This doesn't work for what I need. I need it to set every block in the area randomly, and if possible a way to set the chance of it
     
  4. Minecoll_YT

    Supporter Forums Helper

    Joined:
    Dec 2, 2018
    Messages:
    597
    Likes Received:
    37
    Code (Text):
    1. loop blocks within {_x} to {_x}:
    2.     set loop-block to stone
    3.     chance of 0.4%:
    4.         set loop-block to emerald ore
     
  5. Natalciuu

    Natalciuu Member

    Joined:
    Nov 12, 2020
    Messages:
    20
    Likes Received:
    0
    One of the lines doesnt, work, ive had issues with it before. and if i use from {x} to {x} it makes a line in-between.
    Code (Text):
    1. loop blocks within {_x} to {_x}:
     
  6. Minecoll_YT

    Supporter Forums Helper

    Joined:
    Dec 2, 2018
    Messages:
    597
    Likes Received:
    37
    For me it works fine, which server and skript version?
     
  7. Natalciuu

    Natalciuu Member

    Joined:
    Nov 12, 2020
    Messages:
    20
    Likes Received:
    0
    my server version is 1.16.5 and i should have the lastest skript version.
     
  8. Minecoll_YT

    Supporter Forums Helper

    Joined:
    Dec 2, 2018
    Messages:
    597
    Likes Received:
    37
    Any errors in console? Maybe they are more detailed
     
  9. Natalciuu

    Natalciuu Member

    Joined:
    Nov 12, 2020
    Messages:
    20
    Likes Received:
    0
    yeah, ill have to look, in a bit, the vars specified are coordinates and work just fine. Its just the line of code in of its self.
    --- Double Post Merged, Oct 27, 2021, Original Post Date: Oct 26, 2021 ---
    Just checked, ill send them here.

    Code (Text):
    1. [13:55:10 INFO]: [Skript] Loading variables...
    2. [13:55:10 INFO]: [Skript] Loaded 36 variables in 0.0 seconds
    3. [13:55:11 ERROR]: [Skript] Can't understand this loop: 'loop blocks within {minespos1.%loop-value%} to {minespos2.%loop-value%}' (prison.sk, line 163: loop blocks within {minespos1.%loop-value%} to {minespos2.%loop-value%}:')
    4. [13:55:11 INFO]: [Skript] Loaded 5 scripts with a total of 13 triggers and 21 commands in 0.48 seconds
    5. [13:55:11 INFO]: [Skript] Finished loading.
     
  10. Minecoll_YT

    Supporter Forums Helper

    Joined:
    Dec 2, 2018
    Messages:
    597
    Likes Received:
    37
    you made a little error, send the whole code
     
  11. Natalciuu

    Natalciuu Member

    Joined:
    Nov 12, 2020
    Messages:
    20
    Likes Received:
    0
    Code (Text):
    1. every 10 seconds in world "Prison":
    2.     loop {mines.name::*}:
    3.         loop blocks within {minespos1.%loop-value%} to {minespos2.%loop-value%}:
    4.             set loop-block to stone
    5.             #chance of {mines::%loop-value-1%::panel::chance::*}%:
    6.                 #set loop-block to emerald ore
    the loop {mines.name::*} is for something else, if it affects it i can remove it.
     
  12. Minecoll_YT

    Supporter Forums Helper

    Joined:
    Dec 2, 2018
    Messages:
    597
    Likes Received:
    37
    weird, this code seems okay
     
  13. Natalciuu

    Natalciuu Member

    Joined:
    Nov 12, 2020
    Messages:
    20
    Likes Received:
    0
    it just says "Can't understand this loop:", and if i use for example from instead of within is makes this line in between the two points.
     
    #13 Natalciuu, Oct 27, 2021
    Last edited: Oct 27, 2021

Share This Page

Loading...