View difference between Paste ID: NtjNJVdY and jzynjTJ3
SHOW: | | - or go back to the newest paste.
1
every tick:
2
	loop all players:
3
		if {cooltimeTA::%loop-player%} is not set:
4
			set {cooltimeTA::%loop-player%} to 0
5
		if {cooltimeTA::%loop-player%} > 0:
6
			remove 1 from {cooltimeTA::%loop-player%}
7
8
Function tickConvMSMS(i: integer):
9
	set {_second} to floor({_i}/20)
10
	set {_tick} to {_i}-20*{_second}
11
	set {_minute} to floor({_second}/60)
12
	set {_second} to {_second}-60*{_minute}
13
	set {_tick} to {_tick}*5
14
	if {_tick} < 10:
15
		set {__tick} to "0%{_tick}%"
16
	else:
17
		set {__tick} to "%{_tick}%"
18
	if {_second} < 10:
19
		set {__second} to "0%{_second}%"
20
	else:
21
		set {__second} to "%{_second}%"
22
	if {_minute} < 10:
23
		set {__minute} to "0%{_minute}%"
24
	else:
25
		set {__minute} to "%{_minute}%"
26
	set {tickConvMSMS} to "%{__minute}%:%{__second}%.%{__tick}%"
27
28
command /editcp [<text>] [<text>]:
29
	permission: skript.admin
30
	trigger:
31
		if arg 1 is "select":
32
			set {editcp.mode::%player%} to "s"
33
			set {editcp.name::%player%} to arg 2
34
			message "&a看板を設置すると設定できます"
35
		else if arg 1 is "time":
36
			set {editcp.mode::%player%} to "t"
37
			set {editcp.name::%player%} to arg 2
38
			message "&aYou can set it by placing a signboard"
39
		else if arg 1 is "check":
40
			set {editcp.mode::%player%} to "c"
41
			set {editcp.name::%player%} to arg 2
42
			message "&aYou can set it by placing a signboard"
43
		else if arg 1 is "goal":
44
			set {editcp.mode::%player%} to "g"
45
			set {editcp.name::%player%} to arg 2
46
			message "&aYou can set it by placing a signboard"
47
		else if arg 1 is "off":
48
			set {editcp.mode::%player%} to "o"
49
			clear {editcp.name::%player%}
50
			message "&cswitched off setting of the signboard"
51
		else:
52
			message "&c[Error] &9/editcp &6<mode> <cp name>"
53
			message "&7mode: &eselect, time, check, goal, off"
54
55
on place of sign:
56
	if {editcp.mode::%player%} is "s":
57
		set line 1 of event-block to "&3■■&2■&1|-||&5Select&1||-|&2■&3■■"
58
		set line 2 of event-block to "&8Right click"
59
		set line 3 of event-block to "&0%{editcp.name::%player%}%"
60
		set line 4 of event-block to "&3■■&2■&1|-||&9ground&1||-|&2■&3■■"
61
	if {editcp.mode::%player%} is "t":
62
		set line 1 of event-block to "&3■■&2■&1|-||&cTimeAttack&1||-|&2■&3■■"
63
		set line 2 of event-block to "&8Right click"
64
		set line 3 of event-block to "&0%{editcp.name::%player%}%"
65
		set line 4 of event-block to "&3■■&2■&1|-||&9ground&1||-|&2■&3■■"
66
	if {editcp.mode::%player%} is "c":
67
		set line 1 of event-block to "&3■■&2■&1|-||&5WayPoint&1||-|&2■&3■■"
68
		set line 2 of event-block to "&8Right click"
69
		set line 3 of event-block to "&0%{editcp.name::%player%}%"
70
		set line 4 of event-block to "&3■■&2■&1|-||&9ground&1||-|&2■&3■■"
71
	if {editcp.mode::%player%} is "g":
72
		set line 1 of event-block to "&3■■&2■&1|-||&6Goal&1||-|&2■&3■■"
73
		set line 2 of event-block to "&8Right click"
74
		set line 3 of event-block to "&0%{editcp.name::%player%}%"
75
		set line 4 of event-block to "&3■■&2■&1|-||&9ground&1||-|&2■&3■■"
76
77
on rightclick:
78
	if player's held item is quartz named "&aWayPoint:
79
		event-block is not sign
80
		command "/cp %player%"
81
	if line 2 of event-block is "&7&l:. &9Select &7&l.:":
82
		set {_line2} to line 3 of event-block
83
		replace "&b" in {_line2} with ""
84
		set {cpselect::%player%} to {_line2}
85
		message "&f&l<&e&l< &f&lWP &e&l>&f&l> &aWaypoint has been saved &7(%{editcp.name::%player%}%)"
86
		execute console command "playsound entity.player.levelup master %player% ~ ~ ~ 1 2 1"
87
	if line 2 of event-block is "&7&l:. &6TimeAttack &7&l.:":
88
		{cooltimeTA::%player%} = 0
89
		set {cooltimeTA::%player%} to 4
90
		set {_line2} to line 3 of event-block
91
		replace "&b" in {_line2} with ""
92
		set {enableTA.%{_line2}%::%player%} to false
93
		set {countTA.%{_line2}%::%player%} to 0
94
		message "&f&l<&e&l< &e&lTA &e&l>&f&l> &f%{editcp.name::%player%}% のTAを開始しました。"
95
		execute console command "playsound entity.enderdragon.ambient master %player% ~ ~ ~ 1 1.3 1"
96
		set {enableTA.%{_line2}%::%player%} to true
97
		while {enableTA.%{_line2}%::%player%} is true:
98
			wait a tick
99
			add 1 to {countTA.%{_line2}%::%player%}
100
			if {goalTA.%{_line2}%::%player%} is true:
101
				tickConvMSMS({countTA.%{_line2}%::%player%})
102
				broadcast "&7[&6T&aA&7] &d%player%&a: &b'%{_line2}%' &e&l%{tickConvMSMS}% &7(%{countTA.%{_line2}%::%player%}%Tick)"
103
				if {recordTA.%{_line2}%::%player%} is not set:
104
					set {recordTA.%{_line2}%::%player%} to {countTA.%{_line2}%::%player%}
105
					message "&f&l<&e&l< &e&lTA &e&l>&f&l> &eCongratulations to your first clear!"
106
				else if {recordTA.%{_line2}%::%player%} <= {countTA.%{_line2}%::%player%}:
107
					tickConvMSMS({recordTA.%{_line2}%::%player%})
108
					message "&f&l<&e&l< &e&lTA &e&l>&f&l> Congratulations to clear! &6(Best Time:&l%{tickConvMSMS}%&6)"
109
				else if {recordTA.%{_line2}%::%player%} > {countTA.%{_line2}%::%player%}:
110
					tickConvMSMS({recordTA.%{_line2}%::%player%})
111
					set {recordTA.%{_line2}%::%player%} to {countTA.%{_line2}%::%player%}
112
					message "&f&l<&e&l< &e&lTA &e&l>&f&l> &3自己記録を更新しました! &d(旧自己最高:&l%{tickConvMSMS}%&6)"
113-
                    execute console command "playsound entity.player.levelup master %player% ~ ~ ~"       
113+
                    execute console command "playsound entity.player.levelup master %player% ~ ~ ~ 1 1.0 1"       
114
				set {goalTA.%{_line2}%::%player%} to false
115
				set {enableTA.%{_line2}%::%player%} to false
116
				set {countTA.%{_line2}%::%player%} to 0
117
	if line 2 of event-block is "&7&l:. &cgoal &7&l.:":
118
		set {_line2} to line 3 of event-block
119
		replace "&b" in {_line2} with ""
120
		if {enableTA.%{_line2}%::%player%} is false:
121
			message "&f&l<&e&l< &e&lTA &e&l>&f&l> &cTAを開始していません!"
122
			stop
123
		if distance between event-block and player > 2:
124
			message "&f&l<&e&l< &e&lTA &e&l>&f&l> &4近くまで来てから右クリックしてください!"
125
			stop
126
		set {goalTA.%{_line2}%::%player%} to true
127
		clear {checkpoint.%{cpselect::%{_player}%}%::%{_player}%}
128
	if line 2 of event-block is "&7&l:. &eCheckPoint &7&l.:":
129
		if block below player is air:
130
			message "&c&l<&4&l<&4&l WP &4&l>&c&l> &c空中で設定することはできません! "
131
			stop
132
		set {_line2} to line 3 of event-block
133
		replace "&b" in {_line2} with ""
134
		set {checkpoint.%{_line2}%::%player%} to location of player
135
		set {_line2} to line 3 of event-block
136
		replace "&b" in {_line2} with ""
137
		set {cpselect::%player%} to {_line2}
138
		message "  &f&l<&e&l< &f&lWP &e&l>&f&l> &aWaypoint has been saved &7(%{editcp.name::%player%}%)"
139
        execute console command "playsound entity.player.levelup master %player% ~ ~ ~ 1 2 1"
140
            
141
command /goal [<player>]:
142
	permission: skript.admin
143
	trigger:
144
		set {_player} to arg 1
145
		if arg 1 is not set:
146
			set {_player} to player
147
		clear {checkpoint.%{cpselect::%{_player}%}%::%{_player}%}
148
		add 1 to {clear.%{cpselect::%{_player}%}%::%{_player}%}
149
150
command /checkpoint [<player>]:
151
	aliases: /cp
152
	trigger:
153
		set {_player} to arg 1
154
		if arg 1 is not set:
155
			set {_player} to player
156
		teleport {_player} to location of {checkpoint.%{cpselect::%{_player}%}%::%{_player}%}
157
158
command /item [<player>]:
159
	trigger:
160
		set {_player} to arg 1
161
		if arg 1 is not set:
162
			set {_player} to player
163
		set slot 1 of player to quartz named "&aWaypoint"