Solved how can i give blocks 'owners'

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

GlacialDew

Member
Apr 8, 2018
40
3
8
Norrland
How can I make it to where when a player places a block, it can only be broken by that player and nobody else. Im trying to make a custom gamemode where players will be able to raid but I cant use any extra plugins that dont involve skript, so Factions is not an option.
 
code_language.skript:
on place:
  set {%event-block%.owner} to player
on break:
  if {%event-block%.owner} is not player:
    cancel event
    send "You can break only blocks what you placed"
 
okay.... i do agree with @RaikaS that that is how you do it. That is the simple form, but you are going to run into a few problems with it.

#1 - Your variables file is going to get HUUUUUGGEEEEEEE.
#2 - Staff/Owners will not be able to bypass this.

Suggestions:
- Staff ByPass - Super easy, will allow staff to bypass if they need to
- List Variables - Cleans up your variable file a bit, but also makes it easier to clear out unused variables
- Absent Time - Write in there something about absent players... for example, after a player has not logged in in say a month, their variables are cleared. This is two fold, #1 cleans up your variable file, getting rid of players who dont play anymore #2 unlocks blocks that have been placed but are from players who dont play on the server anymore
 
my attempt:
code_language.skript:
on place:
    set {owner::%event-block%} to player
on break:
    if {owner::%event-block%} != "%player%":
        if {owner::%event-blockt%} has permission "break.bypass"
            delete {owner::%event-block%}
        else:
            cancel event
            send "&cPermission message here (line 9)"
    else:
        delete {owner::%event-block%}

[/CODE=SKRIPT]
 
my attempt:
code_language.skript:
on place:
    set {owner::%event-block%} to player
on break:
    if {owner::%event-block%} != "%player%":
        if {owner::%event-blockt%} has permission "break.bypass"
            delete {owner::%event-block%}
        else:
            cancel event
            send "&cPermission message here (line 9)"
    else:
        delete {owner::%event-block%}

[/CODE=SKRIPT]
this is much better than the other solution
 
Status
Not open for further replies.