Date: 2016/09/09 22:22:58 UTC-07:00
Type: Denizen Script
noplotsme:
type: world
events:
on player places block:
- if <server.has_file[/scripts/NPMchunks/<context.location.chunk.x>,<context.location.chunk.y>.yml]>
{
- yaml "load:/scripts/NPMchunks/<context.location.chunk.x>,<context.location.chunk.y>.yml" id:<context.location.chunk.x>,<context.location.chunk.y>
}
#This area loads chunk yaml if it should exist
- define id <context.location.chunk.x>,<context.location.chunk.y>
#This area defines the name of the chunk as ID
- if <player.in_group[player]>
#If in player
{
- if <yaml.list.contains[%id%]>
#If the chunk contains a yaml
{
- define uuid <yaml[%id%].read[uuid]>
- if <def[uuid]> =! <player.uuid>
#Area determines the uuid of the owner to this area, if the owner is the player affecting it, permission is granted
{
- determine cancelled
- narrate "<&5><<>NoPlotsMe<>>You cannot build here, find some free land instead."
#If the area has a yaml, but isn't yours, you cannot build there
}
else
{
- yaml create id:<context.location.chunk.x>,<context.location.chunk.y>
- yaml id:<context.location.chunk.x>,<context.location.chunk.y> set <player.uuid>
- narrate "<&5><<>NoPlotsMe<>>This chunk is now yours, make some cool junk for the next rank!"
- narrate "<&5>-If your land is found too close to others it can be reset."
- narrate "<&5>-If you don't build in your land for a week it can be reset."
- narrate "<&5>-If your build is found to not be in effort for promotion it can be reset."
}
}
#If the land is free, you are given it