Solved Looping mined blocks then setting to specific 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!

J1nx1l

New Member
Jul 26, 2023
6
0
1
22
I need some assistance with adding blocks to a variable when you break them. After you break them the command should set them back to the original ore but I can't figure it out and there is no threads on it.
Code:
on break:
    if gamemode of player is survival:
        if event-block is diamond ore:
            add location of event-block to {diamondOre::%location of event-block%}
            set event-block to bedrock
           
command /resetores:
    permission: admin.reset.ores
    trigger:
        loop {diamondOre::*}:
            set block at location at {diamondOre::%loop-index%} to diamond ore
            send "{@prefix} Successfully reset all mines!"
 
Last edited:
Hey, you can try this, should help, also you souhld set some prefix..
Code:
on break:
    if gamemode of player is survival:
        if event-block is diamond ore:
            add location of event-block to {diamondOre::*}
            set event-block to bedrock

command /resetores:
    permission: admin.reset.ores
    trigger:
        loop {diamondOre::*}:
            set all loop-blocks at location of {diamondOre::*} to diamond ore
            send "{@prefix} Successfully reset all mines!"
 
Last edited:
Hey, you can try this, should help, also you souhld set some prefix..
Code:
on break:
    if gamemode of player is survival:
        if event-block is diamond ore:
            add location of event-block to {diamondOre::*}
            set event-block to bedrock

command /resetores:
    permission: admin.reset.ores
    trigger:
        loop {diamondOre::*}:
            set all loop-blocks at location of {diamondOre::*} to diamond ore
            send "{@prefix} Successfully reset all mines!"
It doesn't seem to be working, it says it doesn't understand the argument. Is there a different way to loop the blocks then set to diamond ore?
 
It doesn't seem to be working, it says it doesn't understand the argument. Is there a different way to loop the blocks then set to diamond ore?
Mby try updating your skript, or have some addon, bc it works for me..
 
You are massively over complicating this skript. all you need to do is add the location of the broken block to a list, then loop that list that contains all the locations. with that you can then set the block at the "loop-value" to diamond ore.
Code:
on break:
    if player's gamemode is survival:
        if event-block is diamond ore:
            add location of event-block to {diamondore::*}
            set block at event-block to bedrock

command resetore:
    permission: admin.reset.ore
    trigger:
        loop {diamondore::*}:
            set block at loop-value to diamond ore
 
  • Like
Reactions: J1nx1l
You are massively over complicating this skript. all you need to do is add the location of the broken block to a list, then loop that list that contains all the locations. with that you can then set the block at the "loop-value" to diamond ore.
Code:
on break:
    if player's gamemode is survival:
        if event-block is diamond ore:
            add location of event-block to {diamondore::*}
            set block at event-block to bedrock

command resetore:
    permission: admin.reset.ore
    trigger:
        loop {diamondore::*}:
            set block at loop-value to diamond ore

This worked, Thank you so much. I haven't found much issues with anything but looping these dumb bocks!