detect who broke and who placed that block

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

K9Lil

Member
May 26, 2019
11
1
0
24
i wanna make it where lets say you place a melon if you break the melon it will break if someone else breaks the melon it will say not your melon!
 
code_language.skript:
on place:
    event-block is a melon:
        set {melon.owner.%player%} to "%player%"
on break:
    event-block is a melon:
        if {melon.owner.%player%} != "%player%":
            cancel event
            send "Not your melon"
        else:
            uncancel event
I think something like that would be ...
 
ok here what about this what if you add components the the melon to increase the tick speed on break of your melon block it will drop the components based on your {mgc::%player%} which in this case = 5 even if someone else broke it
 
code_language.skript:
on place:
    event-block is a melon:
        set {melon.owner.%player%} to "%player%"
on break:
    event-block is a melon:
        if {melon.owner.%player%} != "%player%":
            cancel event
            send "Not your melon"
        else:
            uncancel event
I think something like that would be ...
Umm. No? You’d have to save the location of the block. Also why are you comparing it to the player within quotes? That makes it a text. You can simply check if it’s a player
 
Status
Not open for further replies.