Date: 2017/05/12 05:55:16 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
animalsellsman_npc:
type: assignment
debug: false
interact scripts:
- 10 animalselsmanscript
actions:
on assignment:
- trigger name:proximity toggle:true radius:5
- trigger name:click toggle:true
- trigger name:chat toggle:true
animalsellsman_inventory:
type: inventory
title: "<&6>Djurbutik"
size: 27
slots:
- "[i@Llama] [i@Donkey] [i@Mule] [i@Vex] [i@Horse] [] [] [] []"
- "[] [] [] [] [] [] [i@Lead] [] []"
- "[] [] [] [] [] [] [] [] []"
Llama:
type: item
material: "383:103"
display name: "<&3>Lama"
lore:
- "<&a>€<&f>5000"
Donkey:
type: item
material: "383:31"
display name: "<&6>Donkey"
Mule:
type: item
material: "383:32"
display name: "<&4>Mule"
Vex:
type: item
material: "383:35"
display name: "<&e>Vex"
Horse:
type: item
material: "383:100"
display name: "<&2>Horse"
Lead:
type: item
material: "420"
display name: "<&6>Koppel"
lore:
- "<&a>€<&f>800"
animalsellsman_inventory_handler:
type: world
events:
on player clicks in animalsellsman_inventory:
- determine cancelled
on player drags in animalsellsman_inventory:
- determine cancelled
on player clicks Llama in animalsellsman_inventory:
- if <player.money> >= "5000" {
- inventory close
- money take qty:5000
- narrate "<&a>€<&e>5000 <&a>Har blivit draget från ditt konto."
- give 383:103
- flag player boughtanimal duration:2h
} else {
- inventory close
- narrate "<yellow>Du har inte tillräckligt med pengar!"
}
on player clicks Donkey in animalsellsman_inventory:
- if <player.money> >= "5000" {
- inventory close
- money take quantity:5000
- narrate "<&a>€<&e>5000 <&a>Har blivit draget från ditt konto."
- give Donkey
- flag player boughtanimal duration:2h
} else {
- inventory close
- narrate "<yellow>Du har inte tillräckligt med pengar!"
}
on player clicks Mule in animalsellsman_inventory:
- if <player.money> >= "5000" {
- inventory close
- money take quantity:5000
- narrate "<&a>€<&e>5000 <&a>Har blivit draget från ditt konto."
- execute as_server "give @p spawn_egg 1 0 {EntityTag:{id:minecraft:mule}}""
- flag player boughtanimal duration:2h
} else {
- inventory close
- narrate "<yellow>Du har inte tillräckligt med pengar!"
}
on player clicks Vex in animalsellsman_inventory:
- if <player.money> >= "8000" {
- inventory close
- money take quantity:8000
- narrate "<&a>€<&e>8000 <&a>Har blivit draget från ditt konto."
- give Vex
- flag player boughtanimal duration:2h
} else {
- inventory close
- narrate "<yellow>Du har inte tillräckligt med pengar!"
}
on player clicks Horse in animalsellsman_inventory:
- if <player.money> >= "3000" {
- inventory close
- money take quantity:3000
- narrate "<&a>€<&e>3000 <&a>Har blivit draget från ditt konto."
- give Horse
- flag player boughtanimal duration:2h
} else {
- inventory close
- narrate "<yellow>Du har inte tillräckligt med pengar!"
}
on player clicks Lead in animalsellsman_inventory:
- if <player.money> >= "800" {
- inventory close
- money take quantity:800
- narrate "<&a>€<&e>800 <&a>Har blivit draget från ditt konto."
- give Lead
} else {
- inventory close
- narrate "<yellow>Du har inte tillräckligt med pengar!"
}
animalselsmanscript:
type: interact
steps:
one*:
click trigger:
script:
- if <player.has_flag[boughtanimal]> {
- narrate "<npc.name>: <green>Du kan inte bara köpa och köpa djur, du måste ta hand om dem också!"
- wait 1
- narrate "<npc.name>: <green>Kom tillbaka om <player.flag[boughtanimal].expiration.formatted>"
- queue clear
}
- narrate "<npc.name>: <green>Välkommen, vad behöver ni idag?"
- wait 1
- inventory open d:in@animalsellsman_inventory