Help with claiming Skript.

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

Computerize

Member
Oct 10, 2019
38
0
0
23
I've made nearly all of my script for claiming in factions, but I've run into a problem which I don't know how to solve. So I each faction has 4 variables for claims:
{factionClaim1x.%{faction}%} {factionClaim2x.%{faction}%} {factionClaim1z.%{faction}%} {factionClaim2z.%{faction}%}
And when claiming, before the claim is complete:
{factionClaiming1x.%{faction}%} {factionClaiming2x.%{faction}%} {factionClaiming1z.%{faction}%} {factionClaiming2z.%{faction}%}
I want to stop people being able to claim other factions land. It would be easy to check if the 4 corner variables listed above were within the claim but it is possible to claim on either side of a claim without including any of the corners. Here is an image of what I am trying to say:
eb2a0247beb110511874ad4cc1d3cf42.png

https://gyazo.com/eb2a0247beb110511874ad4cc1d3cf42

Claim A is currently claiming and has not claimed the land yet. When the player is trying to claim the land I want it to cancel since Claim A has blocks in Claim B inside of the 2 positions.

I want to find a way to stop this somehow. Here is how it starts but I have no idea what to check for next:

Code:
on left click:
  if player's tool is golden hoe named "&6Claiming Wand" with lore "", and "&eRight/Left Click &6Block", and "&b- &fSelect claim's corners", and "", and "&eRight Click &6Air", and "&b- &fCancel current claim", and "", and "&9Crouch Left Click &6Block/Air", and "&b- &fPurchase current claim":
    if player is sneaking:
      if {factionClaiming.%player%} isn't set:
        send "&cYou have not set both positions of this claim selection."
      if {factionClaiming.%player%} is set:
        send "&cYou have not set both positions of this claim selection."
      else:
        loop all offline players:
          if {factionOfPlayer.%loop-value%} is set:
 
Status
Not open for further replies.