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.

Solved Make player break certain blocks

Discussion in 'Skript' started by GiorgixPRO, Sep 29, 2018.

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

    GiorgixPRO Member

    Joined:
    Jul 29, 2017
    Messages:
    44
    Likes Received:
    0
    Hello,
    I made this Skript:
    Code (Skript):
    1.  
    2. on place:
    3.     set {placedblocks.%player%} to location of event-block
    4.     add event-block to {placedblocks.%player%}
    5.    
    6. on break:
    7.     if {placedblocks.%player%} contains location of event-block:
    8.         wait 1 tick
    9.     else:
    10.         cancel event
    Because I want players to only break blocks placed by themselves, but players can't break any block with that Skript.
    Help?
     
  2. Best Answer:
    Post #2 by Donut, Sep 29, 2018
  3. Donut

    Donut Well-Known Member

    Joined:
    Mar 27, 2017
    Messages:
    1,340
    Likes Received:
    176
    Medals:
    {placedblocks.%player%} isnt a list

    you should do something like
    Code (Skript):
    1. on place:
    2.     set {blockOwner::%location of event-block%} to player's uuid
    3.  
    4. on break:
    5.     if {blockOwner::%location of event-block%} is player's uuid:
    6.         delete {blockOwner::%location of event-block%}
    7.     else if {blockOwner::%location of event-block%} is set:
    8.         cancel event
     
  4. GiorgixPRO

    GiorgixPRO Member

    Joined:
    Jul 29, 2017
    Messages:
    44
    Likes Received:
    0
    Thanks.
     
Thread Status:
Not open for further replies.

Share This Page

Loading...