Solved Make player break certain blocks

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

GiorgixPRO

Member
Jul 29, 2017
44
0
0
25
Hello,
I made this Skript:
code_language.skript:
on place:
    set {placedblocks.%player%} to location of event-block
    add event-block to {placedblocks.%player%}
   
on break:
    if {placedblocks.%player%} contains location of event-block:
        wait 1 tick
    else:
        cancel event
Because I want players to only break blocks placed by themselves, but players can't break any block with that Skript.
Help?
 
{placedblocks.%player%} isnt a list

you should do something like
code_language.skript:
on place:
    set {blockOwner::%location of event-block%} to player's uuid

on break:
    if {blockOwner::%location of event-block%} is player's uuid:
        delete {blockOwner::%location of event-block%}
    else if {blockOwner::%location of event-block%} is set:
        cancel event
 
{placedblocks.%player%} isnt a list

you should do something like
code_language.skript:
on place:
    set {blockOwner::%location of event-block%} to player's uuid

on break:
    if {blockOwner::%location of event-block%} is player's uuid:
        delete {blockOwner::%location of event-block%}
    else if {blockOwner::%location of event-block%} is set:
        cancel event
Thanks.
 
Status
Not open for further replies.