Solved How to make a land claiming plugin with Skript

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

MrDuckyRU

Member
Dec 7, 2020
3
0
1
27
Hello! I'm new to skript, and i need help with coding a working land claiming plugin.

So I'm making an anarchy server, where to claim land you have to place certain blocks, and they will claim a radius around them, depending on block type (Diamond block, diamond ore, etc.). and you also will be able to intrude the land claimed with tnt, withers and other exploding stuff, so you can still grief it, but you have to do that from outside (tnt launchers, wither pushing, etc.) I serched u the whole internet, to find similar plugin, but i have not. So I wanted to make my own. I also searched up "how to make a land claiming plugin with skript", but nothing came up. So I'm writing here.

Thanks for helping me!
 
Code:
on place:
  if event-block is diamond block:
    add event-block's location to {diamondclaimed_location::*}
    add player to {diamondclaimed_player::*}
  else:
    loop {diamondclaimed_location::*}:
      if distance between event-block and {diamondclaimed_location::*} is less than <radius>:
        if {diamondclaimed_player::*} is not the player:
          cancel event
          send "&c&lHEY! &7You cannot place that block there!"

One quick problem with this code, you can place blocks above and below the blocks.
I hope this helped to give a head-start!
-William

EDIT: Another problem: anyone can break the diamond blocks, and anyone can destroy everything. I will leave you to solving that problem (hint: it works similar to the code above!)
 
Status
Not open for further replies.