Date: 2015/10/15 16:52:06 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
52
53
54
nsatool:
type: command
name: nsatool
description: "give yourself the area selection tool for npcs. drop item to clear locations"
usage: /nsatool
permission: nsatool.use
script:
- if !<player.has_permission[nsatool.use]> {
- narrate "<red>you do not have permission for this command"
} else {
- give selectiontool qty:1 player:<player>
}
nsatoolsave:
type: command
name: nsasave
description: "save current locations under name"
usage: /nsasave <<>savename<>>
script:
- if <global.flag[sellocation1]> !== global.flag[sellocation1] {
- if <global.flag[sellocation2]> == global.flag[sellocation2] {
- narrate "second selection is <global.flag[sellocation2]>"
- narrate "first selection is <global.flag[sellocation1]>"
- narrate "single selection mode detected"
- flag global nsa_<context.raw_args>:<global.flag[sellocation1]>
} else {
- narrate "second selection is <global.flag[sellocation2]>"
- narrate "first selection is <global.flag[sellocation1]>"
- narrate "cuboid area detected switching modes"
- note cu@<global.flag[sellocation1]>|<global.flag[sellocation2]> as:<context.raw_args>
}
} else {
- narrate "you have no selection defined"
}
selectiontool:
type: item
material: i@wood_axe
display name: selectiontool
selectiontoolhandler:
type: world
events:
on player right clicks block with selectiontool:
- flag global sellocation1:<context.location>
- wait .5
- narrate "location one saved as <global.flag[sellocation1]>"
on player left clicks block with selectiontool:
- flag global sellocation2:<context.location>
- wait .5
- narrate "location two saved as <global.flag[sellocation2]>"
on player drops selectiontool:
- narrate "locations cleared"
- flag global sellocation1:null duration:1s
- flag global sellocation2:null duration:1s
- determine cancelled