There's no loop that matches 'loop-block'

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

retchi

Member
Dec 28, 2021
2
0
1
23
Im new to skript and made this code for periodical block cleaning
Whats wrong?
Code:
on block place:
    region is {arena}
    add event-block to {blocks::clear::*}

every 10 seconds:
    broadcast "&cClearing all placed blocks in 10 seconds"
    wait 10 seconds
    loop {blocks::clear::*}:
        set loop-block to air
    delete {blocks::clear::*}
    broadcast "&aBlocks have been cleared successfully!"
 
Im new to skript and made this code for periodical block cleaning
Whats wrong?
Code:
on block place:
    region is {arena}
    add event-block to {blocks::clear::*}

every 10 seconds:
    broadcast "&cClearing all placed blocks in 10 seconds"
    wait 10 seconds
    loop {blocks::clear::*}:
        set loop-block to air
    delete {blocks::clear::*}
    broadcast "&aBlocks have been cleared successfully!"
Try replacing "loop-block" with "loop-value", if this doesn't work do this:


Code:
on block place:
    region is {arena}
    add location at event-block to {blocks::clear::*}
 
every 10 seconds:
    broadcast "&cClearing all placed blocks in 10 seconds"
    wait 10 seconds
    loop {blocks::clear::*}:
        set block at loop-value to air
    delete {blocks::clear::*}
    broadcast "&aBlocks have been cleared successfully!"

I didn't test it but it should work.

You can only use "loop-block" when you loop all the blocks in an area, for example "loop all blocks within {loc1} and {loc2}:"
 
Try replacing "loop-block" with "loop-value", if this doesn't work do this:


Code:
on block place:
    region is {arena}
    add location at event-block to {blocks::clear::*}
 
every 10 seconds:
    broadcast "&cClearing all placed blocks in 10 seconds"
    wait 10 seconds
    loop {blocks::clear::*}:
        set block at loop-value to air
    delete {blocks::clear::*}
    broadcast "&aBlocks have been cleared successfully!"

I didn't test it but it should work.

You can only use "loop-block" when you loop all the blocks in an area, for example "loop all blocks within {loc1} and {loc2}:"

so
the skript compiled without errors, but it doesn`t work still :/
 
Status
Not open for further replies.