Solved Region argument problem

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

FireKun

Member
Oct 28, 2018
13
1
0
24
Hello all of you, I'm trying to make a reset region skript. The idea is the following one:

Code:
command /mreset [<text>]:
    trigger:
        if arg 1 is not set:
            send "You must put a region name" to player
        if arg 1 is a region:
            make player execute command "//schem load %arg 1%"
            make player execute command "//copy"
            make player execute command "//paste -o"
            wait 4 ticks
            loop all blocks in the region "%arg 1%":
                if loop-block is stone:
                    if block 1 meter below, above, east, west, north or south loop-block is air:
                    if chance of 20%:
                        set loop-block to lapis lazuli
                    if chance of 10%:
                        set loop-block to coal ore
                    if chance of 5%:
                        set loop-block to iron ore

The problem comes in the 10th line. I don't know how to do for looping the arg 1 without puting the region name directly.

If instead of putting "%arg 1%" I put the region name it works:
Code:
command /mreset [<text>]:
    trigger:
        if arg 1 is not set:
            send "Debes poner el nombre de lo que quieres resetear" to player
        if arg 1 is a region:
            make player execute command "//schem load %arg 1%"
            make player execute command "//copy"
            make player execute command "//paste -o"
            wait 4 ticks
            loop all blocks in the region "1":
                if loop-block is stone:
                    if block 1 meter below, above, east, west, north or south loop-block is air:
                    if chance of 20%:
                        set loop-block to lapis lazuli
                    if chance of 10%:
                        set loop-block to coal ore
                    if chance of 5%:
                        set loop-block to iron ore

The first code doesn't work but the second one yes, and I only change de 10th line.

Can someone help me? Thanks.
[doublepost=1570990764,1570975959][/doublepost]Solved.


Code:
command /mreset [<region>]:
    trigger:
        if arg 1 is not set:
            send "Debes poner el nombre de lo que quieres resetear" to player
        if arg 1 is a region:
            make player execute command "//schem load %arg 1%"
            make player execute command "//copy"
            make player execute command "//paste -o"
            wait 4 ticks
            loop all blocks in the region arg-1:
                if loop-block is stone:
                    if block 1 meter below, above, east, west, north or south loop-block is air:
                        if chance of 20%:
                            set loop-block to lapis lazuli
                        if chance of 10%:
                            set loop-block to coal ore
                        if chance of 5%:
                            set loop-block to iron ore
 
Status
Not open for further replies.