On break in region

  • 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.
Hi, I am trying to check if a block inside a region is being destroyed, I usually did that using this code and it worked perfectly:

code_language.skript:
on break:
        if event-block is in the region "a":
                if event-block is coal ore:
                        ##Do something

but I wanted to use variables because I need to make it possible to be re-settable via a command in-game, I used this syntax:

code_language.skript:
on break:
        if event-block is in the region {coal}:
                if event-block is coal ore:
                        ##Do something

where {coal} contains the name of the region, but it's just doing nothing like it's never checking into that region.
Does anyone know how to solve this?
[doublepost=1512737816,1512737072][/doublepost]I also tried using "%coal%" as described here:

code_language.skript:
on break:
        if event-block is in the region "%{coal}%":
                if event-block is coal ore:
                        ##Do something

but it still gives me this error:

DCfFDgaqS1K8_0N6hKBuZg.png
 
code_language.skript:
on break:
    if "%region at event-block%" is "spawn":
        if event-block is coal ore:
            stop
            #Do something
 
code_language.skript:
on break:
    if "%region at event-block%" is "spawn":
        if event-block is coal ore:
            stop
            #Do something


It's still not doing anything as if it's never checking.
 
Last edited:
Region names are in the form “region spawn in world world”

should I set the world after the region? By the way, I am now using PirateSK, it's creating it's own region so that I don't have to mess around with names etc... that's just a pre-set name that the skript is going to use to define that area.
 
Not exactly sure what youre asking, if you broadcast "%region at event-block%" it will look something like “region exampleRegion in world exampleWorld”

also if your using the code uzumaki sent then the 'stop' line is unnecessary and in fact, if youre putting stuff after that line it wont run
 
Status
Not open for further replies.