1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

I am trying to make worldguard but for specific players

Discussion in 'Skript' started by stingly, Jan 23, 2022.

Thread Status:
Not open for further replies.
  1. stingly

    stingly New Member

    Joined:
    Jul 27, 2020
    Messages:
    7
    Likes Received:
    0
    So I am trying to make it so when the player enters a different player's area he can't break anything or drop anything.

    Code (Text):
    1. on block break:
    2.     if player's world is "TheIslands":
    3.         if {island.b::%player%} doesn't contain location of player:
    4.             cancel event
    5.  
    6.  
    7. and:
    8.  
    9. set {island.b::%player%} to locations between location(28.5, 0, {sd} + 28, world "TheIslands") and location(-27.5, 250, {sd} - 28, world "TheIslands")
     
  2. Tenfont

    Tenfont Member

    Joined:
    Mar 28, 2021
    Messages:
    24
    Likes Received:
    2
    Code (Skript):
    1. # for setting
    2. set {island.b::%player%::x::*} to 28.5 and -27.5
    3. set {island.b::%player%::y::*} to {sd} + 28 and {sd} - 28
    4.  
    5. # for checking if a player is not in their region
    6. if x-loc of player is between {island.b::%player%::x::1} and {island.b::%player%::x::2}:
    7.     y-loc of player is between {island.b::%player%::y::1} and {island.b::%player%::y::2}
    8.     stop
    9. # ...
     
  3. stingly

    stingly New Member

    Joined:
    Jul 27, 2020
    Messages:
    7
    Likes Received:
    0
    Thank you so much, love u.
    --- Double Post Merged, Jan 23, 2022, Original Post Date: Jan 23, 2022 ---
    Hello, so there is a problem
    1. if player B does /test it sets an area for that player
    2. then if player C does /test it sets a different area for that player
    3. and when player B mines a block on player C's teretory it cancels the event
    4. but it doesn't work
    and when player has never done "/test" It does work

    Code (Text):
    1. command /test:
    2.     trigger:
    3.         add 1000 to {sd}
    4.         set {island.b::%player%::x::*} to 28.5 and -27.5
    5.         set {island.b::%player%::z::*} to {sd} + 28 and {sd} - 28
    6. on block break:
    7.     if x-loc of player is not between {island.b::%player%::x::1} and {island.b::%player%::x::2}:
    8.         z-loc of player is not between {island.b::%player%::z::1} and {island.b::%player%::z::2}:
    9.             cancel event
     
    • Friendly Friendly x 1
Thread Status:
Not open for further replies.

Share This Page

Loading...