I am trying to make worldguard but for specific players

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

stingly

New Member
Jul 27, 2020
8
0
1
34
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:
on block break:
    if player's world is "TheIslands":
        if {island.b::%player%} doesn't contain location of player:
            cancel event


and:

set {island.b::%player%} to locations between location(28.5, 0, {sd} + 28, world "TheIslands") and location(-27.5, 250, {sd} - 28, world "TheIslands")
 
code_language.skript:
# for setting
set {island.b::%player%::x::*} to 28.5 and -27.5
set {island.b::%player%::y::*} to {sd} + 28 and {sd} - 28

# for checking if a player is not in their region
if x-loc of player is between {island.b::%player%::x::1} and {island.b::%player%::x::2}:
    y-loc of player is between {island.b::%player%::y::1} and {island.b::%player%::y::2}
    stop
# ...
 
Thank you so much, love u.
[doublepost=1642965230,1642959002][/doublepost]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:
command /test:
    trigger:
        add 1000 to {sd}
        set {island.b::%player%::x::*} to 28.5 and -27.5
        set {island.b::%player%::z::*} to {sd} + 28 and {sd} - 28
on block break:
    if x-loc of player is not between {island.b::%player%::x::1} and {island.b::%player%::x::2}:
        z-loc of player is not between {island.b::%player%::z::1} and {island.b::%player%::z::2}:
            cancel event
 
Status
Not open for further replies.