Date: 2016/09/10 19:04:29 UTC-07:00
Type: Denizen Script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
noplotsme:
type: world
events:
on player places block:
- if <server.has_file[/database/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 passively cancelled
- narrate "<&c><<>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
{
- flag <player> chunkreset duration:1w
#If you built to your area, your week timer gets reset
}
}
else if <server.has_file[/database/playerusers/<player.uuid>
{
- determine passively cancelled
- narrate "<&c><<>NoPlotsMe<>>You already own a chunk, rank up for more land."
}
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>
- yaml create id:<player.uuid>
- yaml "savefile:/database/playerusers/<player.uuid>.yml" id:<player.uuid>
- 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."
- flag <player> chunkreset duration:1w
}
}
#If the land is free, you are given it and a file made under your name