-
Notifications
You must be signed in to change notification settings - Fork 0
/
-squidgame-redlightgreenlight.sk
127 lines (118 loc) · 5.3 KB
/
-squidgame-redlightgreenlight.sk
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
function startRedLightGreenLight(world: world):
{squidgame::status} is "game"
send "%yml value "Message_Logo" from "messages"% %yml value "Message_RedLightGreenLight_Instruction" from "messages"%" to {squidgame::players::*}
installBlock({_world}, barrier)
wait 2 seconds # 10 or more
installBlock({_world}, air)
startDoll()
function installBlock(world: world, blockType: itemtype):
loop blocks between {squidgame::redlightgreenlightbarrier1} and {squidgame::redlightgreenlightbarrier2}:
set {_blockLoc} to location of loop-block
set {_x} to x-coordinates of {_blockLoc}
set {_y} to y-coordinates of {_blockLoc}
set {_z} to z-coordinates of {_blockLoc}
set block at {_blockLoc} to {_blockType}
loop 5 times:
add 1 to {_y}
set {_loc} to location({_x}, {_y}, {_z}, world("%{_world}%"))
set block at {_loc} to {_blockType}
function startDoll():
{squidgame::status} is "game"
startTimer()
while {squidgame::timer} is set:
if {squidgame::status} is "game":
set {_integer} to a random integer between 1 and 12
set {squidgame::canmove} to true
send "%yml value "Message_GreenLight" from "messages"%" to {squidgame::players::*}
send title "%yml value "Message_GreenLight" from "messages"%" with subtitle "" to {squidgame::players::*} for 1 seconds with fadein 0.1 second and fade out 0.7 second
play sound "rlgl%{_integer}%" with volume 0.4 to {squidgame::players::*}
set {_time} to getTimeFromMusic({_integer})
wait "%{_time}% seconds" parsed as timespan
{squidgame::status} is "game"
set {squidgame::canmove} to false
send "%yml value "Message_RedLight" from "messages"%" to {squidgame::players::*}
send title "%yml value "Message_RedLight" from "messages"%" with subtitle "" to {squidgame::players::*} for 1 seconds with fadein 0.1 second and fade out 0.7 second
wait 0.5 seconds
loop {squidgame::players::*}:
set {_x} to round x-coordinate of loop-value
set {_y} to round y-coordinate of loop-value
set {_z} to round z-coordinate of loop-value
set metadata "location" of loop-value to location({_x}, {_y}, {_z})
verifyMoving(loop-value)
play sound "rlgl_doll_analyse" with volume 0.4 to {squidgame::players::*}
set {_time} to getTimeFromMusic(0)
{squidgame::status} is "game"
wait "%{_time}% seconds" parsed as timespan
set {_number} to a random number between 0.1 and 1
wait "%{_number}% seconds" parsed as timespan
else:
stop
clear {squidgame::canmove}
function startTimer():
set {squidgame::timer} to true
set {_message_Logo} to yml value "Message_Logo" from "messages"
set {_timer_Count} to yml value "Timer_RedLightGreenLight_InSeconds" from "config"
set {_message_Timer} to yml value "Message_Timer_RedLightGreenLight" from "messages"
while {_timer_Count} >= 1:
if {squidgame::status} is "game":
wait a second
{squidgame::status} is "game"
if {_timer_Count} = 120 or 100 or 80 or 60 or 50 or 40 or 30 or 20 or 15 or 10 or 5 or 4 or 3 or 2 or 1:
set {_messageReal} to {_message_Timer}
replace all "{TIMER}" in {_messageReal} with "%{_timer_Count}%"
send "%{_message_Logo}% %{_messageReal}%" to {squidgame::players::*}
remove 1 from {_timer_Count}
else:
stop
clear {squidgame::timer}
checkFinish()
function getTimeFromMusic(rlglX: integer) :: number:
set {_time} to 0
if {_rlglX} = 0:
set {_time} to 3.13
else if {_rlglX} = 1:
set {_time} to 4.22
else if {_rlglX} = 2:
set {_time} to 4.13
else if {_rlglX} = 3:
set {_time} to 4.02
else if {_rlglX} = 4:
set {_time} to 3.24
else if {_rlglX} = 5:
set {_time} to 3.16
else if {_rlglX} = 6:
set {_time} to 3.00
else if {_rlglX} = 7:
set {_time} to 3.06
else if {_rlglX} = 8:
set {_time} to 2.27
else if {_rlglX} = 9:
set {_time} to 2.15
else if {_rlglX} = 10:
set {_time} to 2.06
else if {_rlglX} = 11:
set {_time} to 2.04
else if {_rlglX} = 12:
set {_time} to 1.16
add 0.3 to {_time}
return {_time}
function verifyMoving(p: player):
while {squidgame::canmove} is false:
wait 5 ticks
{squidgame::canmove} is false
if {squidgame::status} is "game":
metadata "status" of {_p} is "game"
set {_x} to round x-coordinate of {_p}
set {_y} to round y-coordinate of {_p}
set {_z} to round z-coordinate of {_p}
set {_loc} to location({_x}, {_y}, {_z})
if "%metadata "location" of {_p}%" != "%{_loc}%":
block below {_p} is sand
killPlayer({_p})
else:
stop
command /getpack:
trigger:
#set {_url} to "https://www.dropbox.com/s/88t7pylm451c9oz/Squidgame.zip?dl=1"
send the resource pack from "https://www.dropbox.com/s/nk1chn14pkaz95f/Squidgame.zip?dl=1" to the player
#play sound "squidgame" with volume 1 to the player