Check if location of loop blocks are already set in a variable

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

Nova

Member
May 10, 2019
17
0
1
18
Description
Basically, Im making a claim region skript that no one except the players u add can build or break blocks in. And I want that if a region area is already in use, then you cannot make your region there. What I mean by this is that I don't want players making their regions too close. How can I prevent this?

My Code
Code:
on right click on a chest:
    if name of player's tool is "&c&lWand":
        cancel event
        loop blocks in radius 10 of event-block:
            set location of loop-blocks to {crg.regions::%player%}
            set {selectedregion.%player%} to true
        send "&aSuccessfully selected region!"
        send "&aPlease type &7/crg claim <name> &ato claim this region as your own!"
        add "%player%" to {crg.trusted::%player%::*}
        wait 1 tick
        set {crg.regions::%player%} to diamond

The set to diamond was just for testing and it does work. But I want to know if you can check if the looped blocks are already available in another variable. Something like this:

Code:
if {crg.regions::*} = loop-blocks:
        send "&cThis region has already been claimed!"
 
Status
Not open for further replies.