Solved Trying to set blocks in an area between 2 points

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

Natalciuu

Member
Nov 12, 2020
20
0
1
21
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:
every 10 seconds in world "Prison":
    loop {mines.name::*}:
        loop all blocks from {minespos1.%loop-value%} to {minespos2.%loop-value%}:
            set {_block} to random element of {mines::%loop-value-1%::panel::*}
            set block at loop-block to {_block}
 
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:
every 10 seconds in world "Prison":
    loop {mines.name::*}:
        loop all blocks from {minespos1.%loop-value%} to {minespos2.%loop-value%}:
            set {_block} to random element of {mines::%loop-value-1%::panel::*}
            set block at loop-block to {_block}
Code:
set all blocks within {} and {} to random element out of {}
 
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
 
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:
loop blocks within {_x} to {_x}:
 
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.
[doublepost=1635364547,1635272690][/doublepost]Just checked, ill send them here.

Code:
[13:55:10 INFO]: [Skript] Loading variables...
[13:55:10 INFO]: [Skript] Loaded 36 variables in 0.0 seconds
[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%}:')
[13:55:11 INFO]: [Skript] Loaded 5 scripts with a total of 13 triggers and 21 commands in 0.48 seconds
[13:55:11 INFO]: [Skript] Finished loading.
 
Code:
every 10 seconds in world "Prison":
    loop {mines.name::*}:
        loop blocks within {minespos1.%loop-value%} to {minespos2.%loop-value%}:
            set loop-block to stone
            #chance of {mines::%loop-value-1%::panel::chance::*}%:
                #set loop-block to emerald ore

the loop {mines.name::*} is for something else, if it affects it i can remove it.
 
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.
 
Last edited:
Status
Not open for further replies.