View difference between Paste ID: rcieLj2n and p4m2djdT
SHOW: | | - or go back to the newest paste.
1
on right click:
2
	if event-entity's name is "買取":
3
		cancel event
4-
		open chest with 3 row named "&b買取" to player
4+
		add 1 to {itembuy} 
5-
		set slot 26 of player's current inventory to red stained glass pane named "&c計算"
5+
		set {%player%.treadid} to {itembuy}
6
		open chest with 3 row named "買取(取引ID:%{%player%.treadid}%)" to player
7
		set slot 26 of player's current inventory to red stained glass pane named "計算"
8
	if player's tool is stone named "i":
9
		send "%{itembuy}%" 
10
	if player's tool is stone named "s":
11
		set {itembuy} to 0
12-
	if name of player's current inventory contain "&b買取確認":
12+
13
on inventory click:
14-
		if name of clicked item is "&6&l&n%{buy.%player%}%&7&l円":
14+
	if name of player's current inventory contain "買取確認(取引ID:%{%player%.treadid}%)":
15
		cancel event
16
		if name of clicked item is "%{buy.%player%}%円":
17
			if {buy.%player%} >= 1:
18
				set {kakunin.%player%} to 0
19-
				send "&aアイテムを売却して&6&l&n%{buy.%player%}%&7&l円&aを受け取りました"
19+
20
				close event-players's inventory
21
				send "&aアイテムを売却して&c&l&n%{buy.%player%}%&c&l&n円&aを受け取りました"
22
				send "&7所持金確認は[/money]"
23
			if {buy.%player%} = 0:
24-
	if name of event-player's current inventory contain "&b買取":
24+
				close players's inventory
25-
		if name of clicked item is "&c計算":
25+
26
	if name of event-player's current inventory contain "買取(取引ID:%{%player%.treadid}%)":
27
		if name of clicked item is "計算":
28
			cancel event
29
			set {kakunin.%player%} to 1
30
			set {buy.%player%} to 0
31
			loop 26 times:
32
				set {buy::%player%::%loop-number%} to slot loop-number - 1 of event-inventory
33
				set {_tag.%player%} to "TAG_Int" tag of nbt of slot loop-number - 1 of event-inventory
34-
			open chest with 3 row named "&b買取確認" to event-player
34+
35
				add {_item.%player%} * {_tag.%player%} to {buy.%player%} 
36
			open chest with 3 row named "買取確認(取引ID:%{%player%.treadid}%)" to event-player
37-
			set slot 26 of player's current inventory to green stained glass pane named "&6&l&n%{buy.%player%}%&7&l円" with lore "&Fクリックで確定"
37+
38
				set slot loop-number - 1 of player's current inventory to {buy::%player%::%loop-number%}
39-
	if name of event-inventory is "&b買取":
39+
			set slot 26 of player's current inventory to green stained glass pane named "%{buy.%player%}%円" with lore "&Fクリックで確定"
40
on inventory close:
41
	if name of event-inventory is "買取(取引ID:%{%player%.treadid}%)":
42
		if {kakunin.%player%} is 0:
43
			add -1 to {itembuy} 
44-
	if name of event-inventory is "&b買取確認":
44+
45
				set {buy::%player%::%loop-number%} to slot loop-number - 1 of event-inventory
46
			give {buy::%player%::*} to event-player
47
	if name of event-inventory is "買取確認(取引ID:%{%player%.treadid}%)":
48
		if {kakunin.%player%} is 1:
49
			add -1 to {itembuy}
50
			loop 26 times:
51
				set {buy::%player%::%loop-number%} to slot loop-number - 1 of event-inventory
52
			give {buy::%player%::*} to event-player
53
			set {kakunin.%player%} to 0
54
55
command /money:
56
	trigger:
57
		send "&6現在の所持金"
58
		send "&6&l&n%{money.%player%}%"
59