Detecting if a block is in a world guard 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!

Corvex

Member
May 25, 2024
3
0
1
23
Hey,

So im trying to make fortune work on blocks that it doesnt using skript, but only if its in a certain world guard region.

My skript is:
Code:
on break of stone:
    if player's region is stonemine:
    set {_f} to level of fortune on player's tool
    if event-block is stone:
    if {_f} is smaller than 5:
    set {_drops} to random integer between {_f}-2 and {_f}
    give player {_drops} of cobblestone
    if {_f} is greater than 5:
    set {_drops} to random integer between {_f}-5 and {_f}
    give player {_drops} of cobblestone
but it gives me an error saying it cant understand the condition.
Ive tried:
%region at event-block%
%region at event-location%
%region at player%

Please help me
 
regions are defined by the region expression, not dynamic expressions. The correct usage would be to cast the region to a string and compare it to another string like this:
AppleScript:
on break of stone:
    if "%region at player%" is "stonemine":
        set {_f} to level of fortune on player's tool
    if event-block is stone:
        if {_f} is smaller than 5:
            set {_drops} to random integer between {_f}-2 and {_f}
            give player {_drops} of cobblestone
    if {_f} is greater than 5:
        set {_drops} to random integer between {_f}-5 and {_f}
        give player {_drops} of cobblestone