View difference between Paste ID: MCt9CJqa and DjaY3xiX
SHOW: | | - or go back to the newest paste.
1
on join:
2
	set rf max hp of player to 40
3
	command "/heal %player%"
4
5
on damage:
6
	repair attacker's tool
7
	if attacker's tool is iron sword:
8
		if name of attacker's tool contains "ミラクルソード":
9
			set {_weapon::*} to lore of attacker's tool
10
			loop {_weapon::*}:
11
				loop-value contains "&3-&8ID&7:&f":
12
					set {_n} to loop-value
13
					replace "&3-&8ID&7:&f" with "" in {_n}
14
					set {id.%attacker%} to {_n} parsed as number
15
			if {cooltime::%attacker%::%{id.%attacker%}%} <= 0:
16
				set {_weapon::*} to lore of attacker's tool
17
				loop {_weapon::*}:
18
					loop-value contains "&3-&aCooltime&7:&f":
19
						set {_n} to loop-value
20
						replace "&3-&aCooltime&7:&f" with "" in {_n}
21
						set {cooltime::%attacker%::%{id.%attacker%}%} to {_n} parsed as number
22
				add damage to the attacker's health
23
				command "/execute %victim% ~ ~ ~ /particle reddust ~ ~ ~ 0.5 0.5 0.5 0 50"
24
				command "/execute %attacker% ~ ~ ~ /particle heart ~ ~ ~ 0.5 0.5 0.5 0 50"
25
on rightclick with diamond hoe:
26
	if name of event-item contains "マジックミサイル":
27
		set {_weapon::*} to lore of player's tool
28
		loop {_weapon::*}:
29
			loop-value contains "&3-&8ID&7:&f":
30
				set {_n} to loop-value
31
				replace "&3-&8ID&7:&f" with "" in {_n}
32
				set {id.%player%} to {_n} parsed as number
33
		if {cooltime::%player%::%{id.%player%}%} <= 0:
34
			set {_weapon::*} to lore of player's tool
35
			loop {_weapon::*}:
36
				loop-value contains "&3-&aCooltime&7:&f":
37
					set {_n} to loop-value
38
					replace "&3-&aCooltime&7:&f" with "" in {_n}
39
					set {cooltime::%player%::%{id.%player%}%} to {_n} parsed as number
40
			cancel event
41
			set {_loc} to location of event-player
42
			add 1.5 to y-coordinate of {_loc}
43
			set {_a2} to yaw of location of event-player - 270
44
			set {_a1} to Pitch of location of event-player * -1
45
			set {_x} to sin(90-{_a1}) * cos({_a2}) * 0.15
46
			set {_z} to sin(90-{_a1}) * sin({_a2}) * 0.15
47
			set {_y} to cos(90-{_a1}) * 0.15
48
			loop 200 times:
49
				set {_a2} to yaw of location of event-player - 270
50
				set {_a1} to Pitch of location of event-player * -1
51
				add sin(90-{_a1}) * cos({_a2}) * 0.15 to {_x}
52
				add sin(90-{_a1}) * sin({_a2}) * 0.15 to {_z}
53
				add cos(90-{_a1}) * 0.15 to {_y}
54
				add {_x} to x-coordinate of {_loc}
55
				add {_y} to y-coordinate of {_loc}
56
				add {_z} to z-coordinate of {_loc}
57
				execute console command "particle smoke %x-coordinate of {_loc}% %y-coordinate of {_loc}% %z-coordinate of {_loc}% 0.15 0.15 0.15 0 30 force"
58
				if block at {_loc} is not air:
59
					add 1.5 to y-coordinate of {_loc}
60
					execute console command "/playsound minecraft:entity.lightning.impact master @a %x-coordinate of {_loc}% %y-coordinate of {_loc}% %z-coordinate of {_loc}% 5 1"
61
					command "/particle witchMagic %x-coordinate of {_loc}% %y-coordinate of {_loc}% %z-coordinate of {_loc}% 1 1 1 1 80 force"
62
					loop living entities in radius 3 of {_loc}:
63
						make player damage loop-entity by 8
64
					stop
65
				loop living entities in radius 1.5 of {_loc}:
66
					loop-entity is not event-player
67
					loop-entity's gamemode is not spectator
68
					loop-entity is not {pvpfalse::*}
69
					execute console command "/playsound minecraft:entity.lightning.impact master @a %x-coordinate of {_loc}% %y-coordinate of {_loc}% %z-coordinate of {_loc}% 5 1"
70
					command "/particle witchMagic %x-coordinate of {_loc}% %y-coordinate of {_loc}% %z-coordinate of {_loc}% 1 1 1 1 80 force"
71
					make player damage loop-entity by 8
72
					stop
73
				wait 1 ticks
74
	if name of event-item contains "スーパーボール":
75
		set {_weapon::*} to lore of player's tool
76
		loop {_weapon::*}:
77
			loop-value contains "&3-&8ID&7:&f":
78
				set {_n} to loop-value
79
				replace "&3-&8ID&7:&f" with "" in {_n}
80
				set {id.%player%} to {_n} parsed as number
81
		if {cooltime::%player%::%{id.%player%}%} <= 0:
82
			set {_weapon::*} to lore of player's tool
83
			loop {_weapon::*}:
84
				loop-value contains "&3-&aCooltime&7:&f":
85
					set {_n} to loop-value
86
					replace "&3-&aCooltime&7:&f" with "" in {_n}
87
					set {cooltime::%player%::%{id.%player%}%} to {_n} parsed as number
88
			cancel event
89
			execute console command "/execute %player% ~ ~ ~ /playsound minecraft:entity.slime.jump master %player% ~ ~ ~ 1 1"
90
			set {_loc} to location of event-player
91
			add 1.5 to y-coordinate of {_loc}
92
			execute console command "playsound minecraft:BLOCK_ANVIL master @a %x-coordinate of {_loc}% %y-coordinate of {_loc}% %z-coordinate of {_loc}% 1 0"
93
			set {_a2} to yaw of location of event-player - 270
94
			set {_a1} to Pitch of location of event-player * -1
95
			set {_x} to sin(90-{_a1}) * cos({_a2}) * 0.75
96
			set {_z} to sin(90-{_a1}) * sin({_a2}) * 0.75
97
			loop 100 times:
98
				add {_x} to x-coordinate of {_loc}
99
				add {_z} to z-coordinate of {_loc}
100
				if block at {_loc} is not air:
101
					set {_x} to {_x} * -0.5
102
					set {_z} to {_z} * -0.5
103
				execute console command "playsound minecraft:entity.slime.jump master @a %x-coordinate of {_loc}% %y-coordinate of {_loc}% %z-coordinate of {_loc}% 1 2"
104
				execute console command "particle blockcrack %x-coordinate of {_loc}% %y-coordinate of {_loc}% %z-coordinate of {_loc}% 0 0 0 0 10 0 force @a 4261"
105
				loop living entities in radius 2 of {_loc}:
106
					loop-entities is not event-player
107
					loop-entity's gamemode is not spectator
108
					loop-entity is not {pvpfalse::*}
109
					make player damage loop-entity by 7
110
					set {_x} to {_x} * -0.5
111
					set {_z} to {_z} * -0.5
112
				wait a ticks
113
	if name of event-item contains "ショックウェーブ":
114
		set {_weapon::*} to lore of player's tool
115
		loop {_weapon::*}:
116
			loop-value contains "&3-&8ID&7:&f":
117
				set {_n} to loop-value
118
				replace "&3-&8ID&7:&f" with "" in {_n}
119
				set {id.%player%} to {_n} parsed as number
120
		if {cooltime::%player%::%{id.%player%}%} <= 0:
121
			set {_weapon::*} to lore of player's tool
122
			loop {_weapon::*}:
123
				loop-value contains "&3-&aCooltime&7:&f":
124
					set {_n} to loop-value
125
					replace "&3-&aCooltime&7:&f" with "" in {_n}
126
					set {cooltime::%player%::%{id.%player%}%} to {_n} parsed as number
127
			execute console command "/execute %player% ~ ~ ~ /playsound minecraft:entity.player.attack.sweep master @a ~ ~ ~ 1 0"
128
			set {_loc} to location of event-player
129
			add 1.5 to y-coordinate of {_loc}
130
			execute console command "playsound minecraft:BLOCK_ANVIL master @a %x-coordinate of {_loc}% %y-coordinate of {_loc}% %z-coordinate of {_loc}% 1 0"
131
			set {_a2} to yaw of location of event-player - 270
132
			set {_a1} to Pitch of location of event-player * -1
133
			set {_x} to sin(90-{_a1}) * cos({_a2}) * 1
134
			set {_z} to sin(90-{_a1}) * sin({_a2}) * 1
135
			set {_y} to cos(90-{_a1}) * 1
136
			loop 20 times:
137
				add {_x} to x-coordinate of {_loc}
138
				add {_y} to y-coordinate of {_loc}
139
				add {_z} to z-coordinate of {_loc}
140
				if block at {_loc} is not air:
141
					execute console command "particle sweepAttack %x-coordinate of {_loc}% %y-coordinate of {_loc}% %z-coordinate of {_loc}% 1.25 1.25 1.25 0.5 50"
142
					loop living entities in radius 3 of {_loc}:
143
						loop-entities is not event-player
144
						make player damage loop-entity by 12
145
					stop
146
				execute console command "playsound minecraft:entity.player.attack.sweep master @a %x-coordinate of {_loc}% %y-coordinate of {_loc}% %z-coordinate of {_loc}% 0.5 1.2"
147
				execute console command "particle sweepAttack %x-coordinate of {_loc}% %y-coordinate of {_loc}% %z-coordinate of {_loc}% 0 0 0 0 5 force"
148
				loop living entities in radius 1.5 of {_loc}:
149
					loop-entity's gamemode is not spectator
150
					loop-entity is not {pvpfalse::*}
151
					execute console command "particle sweepAttack %x-coordinate of {_loc}% %y-coordinate of {_loc}% %z-coordinate of {_loc}% 1.25 1.25 1.25 0.5 50 force"
152
					make player damage loop-entity by 9
153
					stop
154
				wait a tick
155
	if name of event-item contains "シールドバッシュ":
156
		set {_weapon::*} to lore of player's tool
157
		loop {_weapon::*}:
158
			loop-value contains "&3-&8ID&7:&f":
159
				set {_n} to loop-value
160
				replace "&3-&8ID&7:&f" with "" in {_n}
161
				set {id.%player%} to {_n} parsed as number
162
		if {cooltime::%player%::%{id.%player%}%} <= 0:
163
			set {_weapon::*} to lore of player's tool
164
			loop {_weapon::*}:
165
				loop-value contains "&3-&aCooltime&7:&f":
166
					set {_n} to loop-value
167
					replace "&3-&aCooltime&7:&f" with "" in {_n}
168
					set {cooltime::%player%::%{id.%player%}%} to {_n} parsed as number
169
			cancel event
170
			execute console command "/execute %player% ~ ~ ~ /playsound minecraft:entity.player.attack.strong master @a ~ ~ ~ 1 0"
171
			set {_loc} to location of event-player
172
			add 1 to y-coordinate of {_loc}
173
			execute console command "playsound minecraft:BLOCK_ANVIL master @a %x-coordinate of {_loc}% %y-coordinate of {_loc}% %z-coordinate of {_loc}% 1 0"
174
			set {_a2} to yaw of location of event-player - 270
175
			set {_a1} to Pitch of location of event-player * -1
176
			set {_x} to sin(90-{_a1}) * cos({_a2}) * 1
177
			set {_z} to sin(90-{_a1}) * sin({_a2}) * 1
178
			set {_y} to cos(90-{_a1}) * 1
179
			loop 5 times:
180
				add {_x} to x-coordinate of {_loc}
181
				add {_y} to y-coordinate of {_loc}
182
				add {_z} to z-coordinate of {_loc}
183
				if block at {_loc} is not air:
184
					stop
185
				execute console command "particle crit %x-coordinate of {_loc}% %y-coordinate of {_loc}% %z-coordinate of {_loc}% 0.3 0.3 0.3 0 50"
186
				loop living entities in radius 1.5 of {_loc}:
187
					loop-entities is not event-player
188
					loop-entity's gamemode is not spectator
189
					loop-entity is not {pvpfalse::*}
190
					make player damage loop-entity by 4
191
					set velocity of loop-entity to vector {_x} * 0.75,{_y} + 0.5,{_z} * 0.75
192
					execute console command "particle smoke %x-coordinate of {_loc}% %y-coordinate of {_loc}% %z-coordinate of {_loc}% 0.5 0 0.5 0 25 force"
193
					execute console command "/execute %player% ~ ~ ~ /playsound minecraft:entity.irongolem.hurt master @a ~ ~ ~ 1 1"
194
					stop
195
				wait a tick
196
				set velocity of event-player to vector {_x},{_y} * 0.5,{_z}
197
	if name of event-item contains "スモークフライ":
198
		set {_weapon::*} to lore of player's tool
199
		loop {_weapon::*}:
200
			loop-value contains "&3-&8ID&7:&f":
201
				set {_n} to loop-value
202
				replace "&3-&8ID&7:&f" with "" in {_n}
203
				set {id.%player%} to {_n} parsed as number
204
		if {cooltime::%player%::%{id.%player%}%} <= 0:
205
			set {_weapon::*} to lore of player's tool
206
			loop {_weapon::*}:
207
				loop-value contains "&3-&aCooltime&7:&f":
208
					set {_n} to loop-value
209
					replace "&3-&aCooltime&7:&f" with "" in {_n}
210
					set {cooltime::%player%::%{id.%player%}%} to {_n} parsed as number
211
			set {_loc} to location of event-player
212
			add 1.5 to y-coordinate of {_loc}
213
			execute console command "playsound minecraft:BLOCK_ANVIL master @a %x-coordinate of {_loc}% %y-coordinate of {_loc}% %z-coordinate of {_loc}% 1 0"
214
			set {_a2} to yaw of location of event-player - 270
215
			set {_a1} to Pitch of location of event-player * -1
216
			set {_x} to sin(90-{_a1}) * cos({_a2}) * 1
217
			set {_z} to sin(90-{_a1}) * sin({_a2}) * 1
218
			set {_y} to cos(90-{_a1}) * 1
219
			loop 7 times:
220
				add {_x} to x-coordinate of {_loc}
221
				add {_y} to y-coordinate of {_loc}
222
				add {_z} to z-coordinate of {_loc}
223
				if block at {_loc} is not air:
224
					stop
225
				execute console command "playsound minecraft:entity.bat.takeoff master %player% %x-coordinate of {_loc}% %y-coordinate of {_loc}% %z-coordinate of {_loc}% 0.5 1.2"
226
				execute console command "particle smoke %x-coordinate of {_loc}% %y-coordinate of {_loc}% %z-coordinate of {_loc}% 0.4 0.4 0.4 0 50 force"
227
				loop living entities in radius 2 of {_loc}:
228
					loop-entity is not event-player
229
					loop-entity's gamemode is not spectator
230
					loop-entity is not {pvpfalse::*}
231
					make player damage loop-entity by 3
232
					set velocity of loop-entity to vector {_x} * 0,{_y} + 0.75,{_z} * 0
233
					execute console command "particle cloud %x-coordinate of {_loc}% %y-coordinate of {_loc}% %z-coordinate of {_loc}% 0.5 0 0.5 0 5 force"
234
					stop
235
				wait a tick
236
				set velocity of event-player to vector {_x},{_y},{_z}
237
	if name of event-item contains "コールドバニラ":
238
		set {_weapon::*} to lore of player's tool
239
		loop {_weapon::*}:
240
			loop-value contains "&3-&8ID&7:&f":
241
				set {_n} to loop-value
242
				replace "&3-&8ID&7:&f" with "" in {_n}
243
				set {id.%player%} to {_n} parsed as number
244
		if {cooltime::%player%::%{id.%player%}%} <= 0:
245
			set {_weapon::*} to lore of player's tool
246
			loop {_weapon::*}:
247
				loop-value contains "&3-&aCooltime&7:&f":
248
					set {_n} to loop-value
249
					replace "&3-&aCooltime&7:&f" with "" in {_n}
250
					set {cooltime::%player%::%{id.%player%}%} to {_n} parsed as number
251
			set {_loc} to location of event-player
252
			add 1.5 to y-coordinate of {_loc}
253
			execute console command "playsound minecraft:BLOCK_ANVIL master @a %x-coordinate of {_loc}% %y-coordinate of {_loc}% %z-coordinate of {_loc}% 1 0"
254
			set {_a2} to yaw of location of event-player - 270
255
			set {_a1} to Pitch of location of event-player * -1
256
			set {_x} to sin(90-{_a1}) * cos({_a2}) * 1
257
			set {_z} to sin(90-{_a1}) * sin({_a2}) * 1
258
			set {_y} to cos(90-{_a1}) * 1
259
			loop 40 times:
260-
					add {_x} to x-coordinate of {_loc}
260+
261-
					add {_y} to y-coordinate of {_loc}
261+
262-
					add {_z} to z-coordinate of {_loc}
262+
263-
					loop 20 times:
263+
				loop 20 times:
264-
						set {_numx} to random number between -0.25 and 0.25
264+
					set {_numx} to random number between -0.25 and 0.25
265-
						set {_numy} to random number between -0.25 and 0.25
265+
					set {_numy} to random number between -0.25 and 0.25
266-
						set {_numz} to random number between -0.25 and 0.25
266+
					set {_numz} to random number between -0.25 and 0.25
267-
						execute console command "/particle reddust %x-coordinate of {_loc} + {_numx}% %y-coordinate of {_loc} + {_numy}% %z-coordinate of {_loc} + {_numz}% 0.1 1 -0.1 1 0 force"
267+
					execute console command "/particle reddust %x-coordinate of {_loc} + {_numx}% %y-coordinate of {_loc} + {_numy}% %z-coordinate of {_loc} + {_numz}% 0.1 1 -0.1 1 0 force"
268-
					if block at {_loc} is not air:
268+
269-
						execute console command "particle fallingdust %x-coordinate of {_loc}% %y-coordinate of {_loc} + 0.5% %z-coordinate of {_loc}% 1 1 1 0 50 force @a 022"
269+
					execute console command "particle fallingdust %x-coordinate of {_loc}% %y-coordinate of {_loc} + 0.5% %z-coordinate of {_loc}% 1 1 1 0 50 force @a 022"
270-
						execute console command "/playsound minecraft:entity.shulker_bullet.hit master @a %x-coordinate of {_loc}% %y-coordinate of {_loc} + 0.5% %z-coordinate of {_loc}% 3 1"
270+
					execute console command "/playsound minecraft:entity.shulker_bullet.hit master @a %x-coordinate of {_loc}% %y-coordinate of {_loc} + 0.5% %z-coordinate of {_loc}% 3 1"
271-
						loop living entities in radius 2 of {_loc}:
271+
272-
							loop-entity's gamemode is not spectator
272+
273-
							loop-entities is not event-player
273+
274-
							make player damage loop-entity by 7
274+
275-
							command "/effect %loop-entity% slowness 2 3 true"
275+
						command "/effect %loop-entity% slowness 2 3 true"
276-
						stop
276+
277
				loop living entities in radius 2 of {_loc}:
278-
						loop-entity is not event-player
278+
279
					loop-entity's gamemode is not spectator
280-
						execute console command "particle fallingdust %x-coordinate of {_loc}% %y-coordinate of {_loc} + 0.5% %z-coordinate of {_loc}% 1 1 1 0 50 force @a 022"
280+
					execute console command "particle fallingdust %x-coordinate of {_loc}% %y-coordinate of {_loc} + 0.5% %z-coordinate of {_loc}% 1 1 1 0 50 force @a 022"
281-
						execute console command "/playsound minecraft:entity.shulker_bullet.hit master @a %x-coordinate of {_loc}% %y-coordinate of {_loc} + 0.5% %z-coordinate of {_loc}% 3 1"
281+
					execute console command "/playsound minecraft:entity.shulker_bullet.hit master @a %x-coordinate of {_loc}% %y-coordinate of {_loc} + 0.5% %z-coordinate of {_loc}% 3 1"
282
					make player damage loop-entity by 7
283-
						command "/effect %loop-entity% slowness 5 3 true"
283+
					command "/effect %loop-entity% slowness 5 3 true"
284-
						stop
284+
285-
					wait a ticks
285+
286
	if name of event-item contains "回復薬":
287
		set {_weapon::*} to lore of player's tool
288
		loop {_weapon::*}:
289
			loop-value contains "&3-&8ID&7:&f":
290
				set {_n} to loop-value
291
				replace "&3-&8ID&7:&f" with "" in {_n}
292
				set {id.%player%} to {_n} parsed as number
293
		if {cooltime::%player%::%{id.%player%}%} <= 0:
294
			set {_weapon::*} to lore of player's tool
295
			loop {_weapon::*}:
296
				loop-value contains "&3-&aCooltime&7:&f":
297
					set {_n} to loop-value
298
					replace "&3-&aCooltime&7:&f" with "" in {_n}
299
					set {cooltime::%player%::%{id.%player%}%} to {_n} parsed as number
300
			add 3 to the player's health
301
			execute console command "/execute %player% ~ ~ ~ /particle happyVillager ~ ~1 ~ 0.75 0.75 0.75 0 50 force"
302
			execute console command "/playsound minecraft:entity.shulker_bullet.hit master @a %x-coordinate of {_loc}% %y-coordinate of {_loc} + 0.5% %z-coordinate of {_loc}% 3 1"
303
304
command /weaponstatus [<text>] [<text>] [<number>]:
305
    permission: weapon.sk
306
    aliases: /ws
307
    trigger:
308
        if arg-1 is set:
309
            if arg-2 is "ct":
310
                set line 2 of lore of held item to colored "&3-&aCooltime&7:&f%arg-3%"
311
            if arg-2 is "id":
312
                set line 3 of lore of held item to colored "&3-&8ID&7:&f%arg-3%"
313
            set line 1 of lore of held item to colored "&9&l≪ &6Weapon&a&l-&6Status&9&l ≫"
314
            set the name of held item to colored arg-1
315
        else:
316
            send "&a/weapon &c<weapon name> <weapon status> &c<number>"
317
            send "&aWeaponStatus&7: &bct&7,&bid"
318
319
every 1 seconds in "world":
320
	loop all players:
321
		set {_weapon::*} to lore of loop-player's tool
322
		loop {_weapon::*}:
323
			loop-value-1 contains "&3-&8ID&7:&f":
324
				set {_n} to loop-value-1
325
				replace "&3-&8ID&7:&f" with "" in {_n}
326
				set {id.%loop-player%} to {_n} parsed as number
327
		if {cooltime::%loop-player%::%{id.%loop-player%}%} is not set:
328
			loop 50 times:
329
				set {cooltime::%loop-player%::%loop-number%} to 0
330
		if {cooltime::%loop-player%::%{id.%loop-player%}%} >= 1:
331
			loop 50 times:
332
				remove 1 from {cooltime::%loop-player%::%loop-number%}
333
			if display name of loop-player's held item is set:
334
				send action bar "&d Item &3[ &r%display name of loop-player's held item% &3] &dCooltime &e[ %{cooltime::%loop-player%::%{id.%loop-player%}%}% &e]" to loop-player
335
			else:
336
				send action bar "&d Name &3[ &r%loop-player% &3]" to loop-player
337
		else:
338
			if display name of loop-player's held item is set:
339
				send action bar "&d Item &3[ &r%display name of loop-player's held item% &3] &dCooltime &e[ Already &e]" to loop-player
340
			else:
341
				send action bar "&d Name &3[ &r%loop-player% &3]" to loop-player
342
343
#-fall-damage-cancel-
344
345
on damage:
346
	if damage cause is fall:
347
		cancel event
348
#-Shop-Chest-
349
350
on leftclick on chest:
351
	if player is op:
352
		if player is sneaking:
353
			if block under the event-block is gold block:
354
				cancel event
355
				open chest with 6 rows named "shop-edit" to player
356
				set {_num} to 0
357
				loop 54 times:
358
					set {_shop} to "%inventory name of player's current inventory%"
359
					replace all "-edit" with "" in {_shop}
360
					set slot {_num} of player's current inventory to {%{_shop}%::%{_num}%}
361
					add 1 to {_num}
362
363
on rightclick on chest:
364
	if block under the event-block is gold block:
365
		cancel event
366
		open chest with 6 rows named "shop" to player
367
		set {_num} to 0
368
		loop 54 times:
369
			set {_shop} to "%inventory name of player's current inventory%"
370
			set slot {_num} of player's current inventory to {%{_shop}%::%{_num}%}
371
			add 1 to {_num}
372
373
on inventory close:
374
    if inventory name of player's current inventory contain "-edit":
375
        set {_num} to 0
376
        loop 54 times:
377
            set {_shop} to "%inventory name of player's current inventory%"
378
            replace all "-edit" with "" in {_shop}
379
            set {%{_shop}%::%{_num}%} to slot {_num} of player's current inventory
380
            add 1 to {_num}
381
        send "&6%{_shop}%&7の情報を保存しました"
382
383
#-Timer-
384
385
command /timer [<number>]:
386
	permission: sk.admin
387
	trigger:
388
		set {timer} to arg-1
389
		set {progress} to 100 / arg-1
390
		set {ppercent} to 100
391
392
every 1 seconds in "world":
393
	if {timer} >= 0:
394
		loop all players:
395
			create bossbar titled "&e[ %{timer}% Seconds &e]" and id "timer" for loop-player with progress {ppercent} with colors green
396
		remove {progress} from {ppercent}
397
		remove 1 from {timer}
398
	else if {timer} <= 0:
399
		remove bossbar "timer"
400
		delete {player::*}
401
		set {ffa} to false
402
		send all players title "&4! - &cタイムアップ&4 - !" for 3 seconds
403
		teleport all players to {lobby}
404
		delete {timer}
405
406
#-Gamemode-
407
408
command /game [<text>]:
409
	permission: sk.admin
410
	trigger:
411
		if arg-1 is "ffa":
412
			ffastart(player)
413
		if arg-1 is "tdm":
414
			tdmstart(player)
415
		if arg-1 is not set:
416
			send "&c/game ffa,tdm"
417
418
command /ss [<text>]:
419
	permission: sk.admin
420
	trigger:
421
		if arg-1 is "lobby":
422
			send "&a待機場所を設定しました。"
423
			set {lobby} to location of event-player
424
		if arg-1 is "ffa":
425
			send "&a待機場所を設定しました。"
426
			set {ffa} to location of event-player
427
		if arg-1 is "blue":
428
			send "&a待機場所を設定しました。"
429
			set {bspawn} to location of event-player
430
		if arg-1 is "red":
431
			send "&a待機場所を設定しました。"
432
			set {rspawn} to location of event-player
433
434
435
on quit:
436
	if {player::*} contains "%player%":
437
		remove player from {player::*}
438
		death()
439
440
on join:
441
	if {game} is true:
442
		send "&c試合がすでに始まっているので観戦です。"
443
		send "&c少々お待ちください。"
444
		set player's gamemode to spectator
445
		teleport player to {lobby}
446
	else:
447
		teleport player to {lobby}
448
		set player's gamemode to adventure
449
450
on damage of player:
451
    if {pvpfalse::*} contains "%victim%":
452
        cancel event
453
        stop
454
    else:
455
        health of victim*2 <= final damage
456
        cancel event
457
        broadcast "&7%attacker% &f≪&r%display name of attacker's held item%&f≫ &ckilled &7%victim%"
458
        heal victim
459
        set victim's gamemode to spectator
460
        remove victim from {player::*}
461
        death()
462
463
function ffastart(p: player):
464
    if {game} is not set:
465
        set {game} to false
466
    else if {game} is true:
467
        send "&cもうすでに試合が始まっています。" to {_p}
468
    else if {game} is false:
469
        start()
470
        wait 5 seconds
471
        teleport all players to {ffa}
472
473
function start():
474
    delete {player::*}
475
    broadcast "&a5秒後にスタートします..."
476
    wait 2 seconds
477
    send all players title "&6[ &a3 &6]" for 1 seconds
478
    wait 1 seconds
479
    send all players title "&6[ &e2 &6]" for 1 seconds
480
    wait 1 seconds
481
    send all players title "&6[ &c1 &6]" for 1 seconds
482
    wait 1 seconds
483
    send all players title "&6[ &aSTART &6]" for 1 seconds
484
    loop all players:
485
        add loop-player to {player::*}
486
        remove loop-player from {pvpfalse::*}
487
    set {_num} to number of {player::*}
488
    broadcast "&b残り%{_num}%人です。"
489
    command "/timer 600"
490
    set {game} to true
491
492
function tdmstart(p: player):
493
	if {game} is not set:
494
		set {game} to false
495
	else if {game} is true:
496
		send "&cもうすでに試合が始まっています。" to {_p}
497
	else if {game} is false:
498
		loop all players:
499
			if number of {red::*} is 0:
500
				add loop-player to {red::*}
501
				send loop-player title "&6[ &c赤チーム &6]" for 3 seconds
502
			if number of {red::*} = number of {blue::*}:
503
				add loop-player to {red::*}
504
				send loop-player title "&6[ &c赤チーム &6]" for 3 seconds
505
			if number of {red::*} > number of {blue::*}:
506
				add loop-player to {blue::*}
507
				send loop-player title "&6[ &9蒼チーム &6]" for 3 seconds
508
			teleport {blue::*} to {bspawn}
509
			teleport {red::*} to {rspawn}
510
		start()
511
512
function death():
513
    set {_num} to number of {player::*}
514
    if {_num} <= 1:
515
        broadcast "&eWinner &8- &b%{players::*}%"
516
        set {game} to false
517
        loop all players:
518
            add loop-player to {pvpfalse::*}
519
        teleport all players to {lobby}
520
        delete {timer}
521
        remove bossbar "timer"
522
    else:
523
        broadcast "&b残り%{_num}%人です。"