Block Owner

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

BALTICA

New Member
Jun 7, 2021
7
0
1
50
I have a working script to add a "block owner" to the jungle wood blocks placed by a player.

I would like to add, that when player 1 places jungle wood in a radius of 2 blocks around another block of jungle wood of player 2, the "block owner" of player 1 is not saved.

sorry for my bad English


Code:
on place jungle planks:
    set {owner::%event-block%} to player
on break jungle planks:
    if {owner::%event-block%} != "%player%":
        if gamemode of player is creative:
            delete {owner::%event-block%}
        else:
            cancel event
            send "&cYou cannot break someone else's structures."
    else:
        delete {owner::%event-block%}
 
Code:
on place jungle planks:
    set {owner::%location of event-block%} to player

on break jungle planks:
    if {owner::%location of event-block%} != player:
        if gamemode of player is creative:
            delete {owner::%location of event-block%}
        else:
            cancel event
            send "&cYou cannot break someone else's structures."
    else:
        delete {owner::%location of event-block%}

"event-block" is "jungle planks", so everything would be the same
 
  • Like
Reactions: BALTICA
Status
Not open for further replies.