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.

Prevent certain block places on others plot

Discussion in 'Skript' started by Romeon, Apr 30, 2020.

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

    Romeon New Member

    Joined:
    Apr 2, 2020
    Messages:
    5
    Likes Received:
    0
    Hi!
    Is there a way so that people that are added to my plot are not able to place a certain block like hay bale?
    They should be able to then place it on their own plot tho. Not others.
    Plugin I use for plots: Plotsquared
     
  2. Abdera7mane

    Abdera7mane Active Member

    Joined:
    Aug 18, 2019
    Messages:
    56
    Likes Received:
    7
    yes it is possible but, please before asking here at least you come with some knowledge on what are you making, tell us what have you tried.

    anyway, save the plots chunk in a list:
    Code (Text):
    1. set {plots::%player's chunk%} to player's uuid
    to know if this chunk is used by other players you can check if {plots::%player's chunk%} is set

    Code (Text):
    1.  
    2. if {plots::%player's chunk%} is set:
    3.     send "this plot is owned by other players" to player
    4.  
     
  3. Romeon

    Romeon New Member

    Joined:
    Apr 2, 2020
    Messages:
    5
    Likes Received:
    0
    hey!
    Thanks for your response.
    I used:

    on command "/plot add":
    set {plots::%player's chunk%} to player's uuid

    on any movement:
    if {plots::%player's chunk%} is set:
    send "this plot is owned by other players" to player

    This will send a message to all players instead of just the player that got added. When u step into a chunk that is near the plot it will sned that message. But its also a little outside the plot and also not all parts of the plot.
     
    #3 Romeon, Apr 30, 2020
    Last edited: May 1, 2020
  4. Abdera7mane

    Abdera7mane Active Member

    Joined:
    Aug 18, 2019
    Messages:
    56
    Likes Received:
    7
    then check if the player owns that plot (chunk)
    Code (Text):
    1.  
    2. if {plots::%player's chunk%} is set:
    3.     set {_owner} to {plots::%player's chunk%} parsed as player #remember {plots::*} contains player's uuids as values so we need to get the actual player from the uuid
    4.     if {_owner} is not player:
    5.         send "this plot is owned by other players" to player
    6.  
     
  5. Romeon

    Romeon New Member

    Joined:
    Apr 2, 2020
    Messages:
    5
    Likes Received:
    0
    [​IMG]
    --- Double Post Merged, May 1, 2020, Original Post Date: May 1, 2020 ---
    https://imgur.com/a/FwqLnKl as you can see a plot it not a chunk
     
  6. Abdera7mane

    Abdera7mane Active Member

    Joined:
    Aug 18, 2019
    Messages:
    56
    Likes Received:
    7
    this way it turned to be more complex since the plots can have custom size (after seeing the screenshot you sent) and they don't follow a static rule, I can't give a direct solution for this .. sorry
     
  7. Romeon

    Romeon New Member

    Joined:
    Apr 2, 2020
    Messages:
    5
    Likes Received:
    0
    alright man, thanks for your help anyways
     
Thread Status:
Not open for further replies.

Share This Page

Loading...