szumielxd

discoPodloga

Jan 8th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.60 KB | None | 0 0
  1. options:
  2. small_lamp: location(7132, 106, 7015, world "katedra")
  3. small_floor: location(7134, 106, 7016, world "katedra")
  4. redstone: location(7123, 107, 7019, world "katedra")
  5.  
  6.  
  7. on enter region "mostbieg_brama":
  8. clear metadata value "discopodl.pkt" of player
  9. loop all players in radius 10 around player:
  10. if "%loop-player%" is not "%player%":
  11. if "%region at loop-player%" contains "mostbieg_brama":
  12. stop
  13. disco_rl()
  14.  
  15. on enter region:
  16. "%region%" contains "mostbieg_blok":
  17. if metadata value "discopodl.pkt" of player = 5:
  18. stop
  19. loop 10 times:
  20. wait 2 ticks
  21. if player's location is in region:
  22. player is on ground:
  23. exit 3 sections
  24. else:
  25. stop
  26. set {_b} to block below player
  27. block below player is {_b}:
  28. set {_pkt} to metadata value "discopodl.pkt" of player
  29. if {_pkt} is not set:
  30. set {_pkt} to 0
  31. set {_xc} to x-coordinates of {@small_lamp}
  32. set {_yc} to y-coordinates of {@small_lamp}
  33. set {_zc} to z-coordinates of {@small_lamp}
  34. set {_l} to block at location({_xc}, {_yc}, {_zc} + {_pkt}, world "katedra")
  35. set {_a} to "%{_b}%"
  36. set {_k} to "%{_l}%"
  37. replace all " wool" with "" in {_a}
  38. replace all " glass block" with "" in {_k}
  39. if {_a} is {_k}:
  40. set block at location({_xc}-1, {_yc}-1, {_zc} + {_pkt} , world "katedra") to redstone block
  41. add 1 to {_pkt}
  42. set metadata value "discopodl.pkt" of player to {_pkt}
  43. randFloor()
  44. if {_pkt} = 5:
  45. play sound "entity.cat.purr" with volume 1 at player
  46. set block at {@redstone} to redstone block
  47. wait 5 seconds
  48. set block at {@redstone} to air
  49. clear metadata value "discopodl.pkt" of player
  50. disco_rl()
  51. else:
  52. play sound "entity.cat.ambient" with volume 0.7 and pitch 2 at player
  53. else:
  54. play sound "minecraft:entity.cat.hiss" with volume 1 at player
  55. clear metadata value "discopodl.pkt" of player
  56. disco_rl()
  57.  
  58.  
  59.  
  60.  
  61. on load:
  62. disco_rl()
  63.  
  64.  
  65.  
  66. function randLamp():
  67. loop 5 times:
  68. set {_z} to loop-number -1
  69. set {_r} to random integer between 1 and 6
  70. loop 5 times:
  71. if {_randoms::*} contains {_r}:
  72. set {_r} to {_r} +1
  73. if {_r} > 6:
  74. set {_r} to 1
  75. add {_r} to {_randoms::*}
  76. set {_xc} to x-coordinates of {@small_lamp}
  77. set {_yc} to y-coordinates of {@small_lamp}
  78. set {_zc} to z-coordinates of {@small_lamp}
  79. if {_r} is 1:
  80. set block at location({_xc}, {_yc}, {_zc} + {_z}, world "katedra") to light green glass block
  81. if {_r} is 2:
  82. set block at location({_xc}, {_yc}, {_zc} + {_z}, world "katedra") to pink glass block
  83. if {_r} is 3:
  84. set block at location({_xc}, {_yc}, {_zc} + {_z}, world "katedra") to yellow glass block
  85. if {_r} is 4:
  86. set block at location({_xc}, {_yc}, {_zc} + {_z}, world "katedra") to red glass block
  87. if {_r} is 5:
  88. set block at location({_xc}, {_yc}, {_zc} + {_z}, world "katedra") to light blue glass block
  89. if {_r} is 6:
  90. set block at location({_xc}, {_yc}, {_zc} + {_z}, world "katedra") to purple glass block
  91.  
  92.  
  93.  
  94. function randFloor():
  95. set {_xc} to x-coordinates of {@small_floor}
  96. set {_yc} to y-coordinates of {@small_floor}
  97. set {_zc} to z-coordinates of {@small_floor}
  98. loop 2 times:
  99. set {_x} to loop-number
  100. remove 1 from {_x}
  101. loop 3 times:
  102. set {_z} to loop-number-2
  103. remove 1 from {_z}
  104. set {_r} to random integer between 1 and 6
  105. loop 5 times:
  106. if {_randoms::*} contains {_r}:
  107. set {_r} to {_r} +1
  108. if {_r} > 6:
  109. set {_r} to 1
  110. add {_r} to {_randoms::*}
  111. set {_b} to block at location({_xc} + {_x}, {_yc}, {_zc} + {_z}, world "katedra")
  112. if {_r} is 1:
  113. set block at location({_xc} + {_x}, {_yc}, {_zc} + {_z}, world "katedra") to light green wool block
  114. if {_r} is 2:
  115. set block at location({_xc} + {_x}, {_yc}, {_zc} + {_z}, world "katedra") to pink wool block
  116. if {_r} is 3:
  117. set block at location({_xc} + {_x}, {_yc}, {_zc} + {_z}, world "katedra") to yellow wool block
  118. if {_r} is 4:
  119. set block at location({_xc} + {_x}, {_yc}, {_zc} + {_z}, world "katedra") to red wool block
  120. if {_r} is 5:
  121. set block at location({_xc} + {_x}, {_yc}, {_zc} + {_z}, world "katedra") to light blue wool block
  122. if {_r} is 6:
  123. set block at location({_xc} + {_x}, {_yc}, {_zc} + {_z}, world "katedra") to purple wool block
  124. add {_r} to {_randoms::*}
  125.  
  126. function disco_rl():
  127. set {_x} to x-coordinates of {@small_lamp}
  128. set {_y} to y-coordinates of {@small_lamp}
  129. set {_z} to z-coordinates of {@small_lamp}
  130. loop 5 times:
  131. set block at location({_x} -1, {_y} -1, {_z} + loop-number -1, world "katedra") to air
  132. randFloor()
  133. randLamp()
  134. set block at {@redstone} to air
Add Comment
Please, Sign In to add comment