szumielxd

oczko

Jan 4th, 2019
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.85 KB | None | 0 0
  1. command /oczkosave <integer>:
  2. permission: wlasciciel
  3. trigger:
  4. type of player's tool is any head:
  5. set {oczko.glowa::%arg%} to player's tool
  6. send "&aZapisano przedmiot do &4%arg% &aslotu"
  7. else:
  8. send "&cTo nie jest glowa"
  9.  
  10. command /oczkoget <integer>:
  11. permission: wlasciciel
  12. trigger:
  13. add 1 of {oczko.glowa::%arg%} to player's inventory
  14. send "&aOtrzymales glowke nr &4%arg%"
  15.  
  16. command /oczkolist:
  17. permission: wlasciciel
  18. trigger:
  19. send "&2&lDostepne numery:"
  20. loop {oczko.glowa::*}:
  21. send " &a%loop-index%"
  22.  
  23.  
  24. command /oczko:
  25. permission: op
  26. trigger:
  27. open(player, 0)
  28.  
  29.  
  30.  
  31.  
  32. function pkt(p: player) :: boolean:
  33. set {_g} to 0
  34. set {_c} to 1
  35. while slot {_c}*9-9 of {_p}'s current inventory is any head:
  36. add item amount of slot {_c}*9-9 of {_p}'s current inventory to {_g}
  37. add 1 to {_c}
  38. set {_c} to 1
  39. set {_a} to 0
  40. while slot {_c}*9-1 of {_p}'s current inventory is any head:
  41. add item amount of slot {_c}*9-1 of {_p}'s current inventory to {_a}
  42. add 1 to {_c}
  43. if {_a} > 21:
  44. return false
  45. if {_g} > 21:
  46. return true
  47.  
  48.  
  49.  
  50.  
  51. on inventory click:
  52. if name of player's current inventory is "&5&lGra w Oczko":
  53. cancel event
  54. if metadata "oczko.los" of player is true:
  55. send "&4Juz losujesz"
  56. stop
  57. if slot clicked slot of player's current inventory is jukebox of knockback 10 named "&6&lRzuc Kostka!":
  58. set {_a} to item amount of clicked slot + 1
  59. set slot clicked slot of player's current inventory to {_a} of jukebox of knockback 10 named "&6&lRzuc Kostka!"
  60. set metadata "oczko.los" of player to true
  61. set {_b} to item amount of slot 13 of player's current inventory - 1
  62. set {_s} to 0
  63. set {_c} to 1
  64. while slot {_c}*9-9 of player's current inventory is any head:
  65. add item amount of slot {_c}*9-9 of player's current inventory to {_s}
  66. add 1 to {_c}
  67. if {_s} > 15:
  68. set slot {_b}*9-9 of player's current inventory to 1 of 166
  69. else:
  70. set {_r} to random integer between 2 and 12
  71. set {_x} to 100+{_r}
  72. set slot {_b}*9-9 of player's current inventory to {_r} of {oczko.glowa::%{_x}%}
  73. losLewo(player, 60)
  74. losPrawo(player, 90)
  75. stop
  76. else:
  77. if slot clicked slot of player's current inventory is bed:
  78. endConsole(player)
  79.  
  80.  
  81.  
  82. function endConsole(p: player):
  83. set metadata "oczko.los" of {_p} to true
  84. if name of {_p}'s current inventory is "&5&lGra w Oczko":
  85. set {_b} to item amount of slot 13 of {_p}'s current inventory
  86. set {_s} to 0
  87. set {_c} to 1
  88. while slot {_c}*9-9 of {_p}'s current inventory is any head:
  89. add item amount of slot {_c}*9-9 of {_p}'s current inventory to {_s}
  90. add 1 to {_c}
  91.  
  92. set {_a} to 0
  93. set {_c} to 1
  94. while slot {_c}*9-1 of {_p}'s current inventory is any head:
  95. add item amount of slot {_c}*9-1 of {_p}'s current inventory to {_a}
  96. add 1 to {_c}
  97. if {_a} < {_s}:
  98. if {_s} < 21:
  99. wait 1 second
  100. close {_p}'s inventory
  101. send {_p} title "&4&lPrzegrales" with subtitle "&7Sprobuj jeszcze raz" for 3 seconds
  102. clear metadata "oczko.los" of {_p}
  103. stop
  104.  
  105. if {_s} <= 15:
  106. set {_r} to random integer between 2 and 12
  107. set {_x} to 100+{_r}
  108. set slot {_b}*9-9 of {_p}'s current inventory to {_r} of {oczko.glowa::%{_x}%}
  109. set slot {_b}*9-1 of {_p}'s current inventory to 1 of 166
  110. set {_b} to item amount of slot 13 of {_p}'s current inventory +1
  111. set slot 13 of {_p}'s current inventory to {_b} of jukebox of knockback 10 named "&6&lRzuc Kostka!"
  112. wait 1 seconds
  113. endConsole({_p})
  114. else:
  115. wait 2 seconds
  116. if {_s} > 21:
  117. send "&aWygrales!" to {_p}
  118. if type of {_p}'s current inventory's slot 46 is beacon:
  119. set {_x} to (item amount of {_p}'s current inventory's slot 46) + 1
  120. else:
  121. set {_x} to 1
  122. open({_p}, {_x})
  123. clear metadata "oczko.los" of {_p}
  124. stop
  125. set {_a} to 0
  126. set {_c} to 1
  127. while slot {_c}*9-1 of {_p}'s current inventory is any head:
  128. add item amount of slot {_c}*9-1 of {_p}'s current inventory to {_a}
  129. add 1 to {_c}
  130. if {_a} > {_s}:
  131. send "&aWygrales!" to {_p}
  132. if type of {_p}'s current inventory's slot 46 is any beacon:
  133. set {_x} to (item amount of {_p}'s current inventory's slot 46) + 1
  134. else:
  135. set {_x} to 1
  136. open({_p}, {_x})
  137. clear metadata "oczko.los" of {_p}
  138. stop
  139. else:
  140. close {_p}'s inventory
  141. send {_p} title "&4&lPrzegrales" with subtitle "&7Sprobuj jeszcze raz" for 3 seconds
  142. clear metadata "oczko.los" of {_p}
  143. stop
  144. else:
  145. clear metadata "oczko.los" of {_p}
  146.  
  147.  
  148.  
  149. function losLewo(p: player, i: integer):
  150. if name of {_p}'s current inventory is "&5&lGra w Oczko":
  151. set slot 39 of {_p}'s current inventory to slot 40 of {_p}'s current inventory
  152. set slot 40 of {_p}'s current inventory to slot 41 of {_p}'s current inventory
  153. set {_r} to random integer between 1 and 6
  154. set slot 41 of {_p}'s current inventory to {_r} of {oczko.glowa::%{_r}%} named " "
  155. if {_i}<9:
  156. wait "%2*(10-{_i})% ticks" parsed as timespan
  157. else:
  158. wait 1 tick
  159. if {_i}<2:
  160. clear metadata "oczko.los" of {_p}
  161. stop
  162. set {_i} to "%{_i} - 1%" parsed as integer
  163. losLewo({_p}, {_i})
  164.  
  165.  
  166. function losPrawo(p: player, i: integer) :: boolean:
  167. if name of {_p}'s current inventory is "&5&lGra w Oczko":
  168. set slot 33 of {_p}'s current inventory to slot 32 of {_p}'s current inventory
  169. set slot 32 of {_p}'s current inventory to slot 31 of {_p}'s current inventory
  170. set slot 31 of {_p}'s current inventory to slot 30 of {_p}'s current inventory
  171. set slot 30 of {_p}'s current inventory to slot 29 of {_p}'s current inventory
  172. set {_r} to random integer between 1 and 6
  173. set slot 29 of {_p}'s current inventory to {_r} of {oczko.glowa::%{_r}%} named " "
  174. if {_i}<2:
  175. wait 15 ticks
  176. clear metadata "oczko.los" of {_p}
  177. set {_a} to 0
  178. add item amount of slot 31 of {_p}'s current inventory to {_a}
  179. add item amount of slot 40 of {_p}'s current inventory to {_a}
  180. set {_b} to item amount of slot 13 of {_p}'s current inventory - 1
  181. set {_x} to 100+{_a}
  182. set slot {_b}*9-1 of {_p}'s current inventory to {_a} of {oczko.glowa::%{_x}%}
  183.  
  184. set {_win} to pkt({_p})
  185. # send "%pkt({_p})%" to {_p}
  186. if {_win} is true:
  187. wait 1 second
  188. send "&aWygrales!" to {_p}
  189. if type of {_p}'s current inventory's slot 46 is any beacon:
  190. set {_x} to (item amount of {_p}'s current inventory's slot 46) + 1
  191. else:
  192. set {_x} to 1
  193. open({_p}, {_x})
  194. stop
  195. if {_win} is false:
  196. wait 1 second
  197. close {_p}'s inventory
  198. send {_p} title "&4&lPrzegrales" with subtitle "&7Sprobuj jeszcze raz" for 3 seconds
  199. stop
  200.  
  201. if {_i}<9:
  202. wait "%2*(10-{_i})% ticks" parsed as timespan
  203. else:
  204. wait 1 tick
  205. set {_i} to "%{_i} - 1%" parsed as integer
  206. losPrawo({_p}, {_i})
  207. else:
  208. clear metadata "oczko.los" of {_p}
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216. function open(p: player, gry: number):
  217. if {_gry} is 3:
  218. send {_p} title "&2&lWygrales!" with subtitle "&7Biegnij dalej i ciesz sie swoim akacjowym kolkiem!" for 5 seconds
  219. open chest with 6 rows named "&5&lGra w Oczko" to {_p}
  220. wait 2 ticks
  221. clear metadata "oczko.los" of {_p}
  222. set {_p}'s current inventory's slot 0 to 1 of pink stained glass pane of lure 10 named "Pusty slot na rzuty"
  223. set {_p}'s current inventory's slot 1 to 1 of {oczko.glowa::1000} named "&6Pijany Joe"
  224. set {_p}'s current inventory's slot 2 to 1 of black stained glass pane named " "
  225. set {_p}'s current inventory's slot 3 to 1 of 426 named " "
  226. set {_p}'s current inventory's slot 4 to 1 of black stained glass pane named " "
  227. set {_p}'s current inventory's slot 5 to 1 of 426 named " "
  228. set {_p}'s current inventory's slot 6 to 1 of black stained glass pane named " "
  229. set {_p}'s current inventory's slot 7 to 1 of {_p}'s skull named "&6Jakis przystojniak"
  230. set {_p}'s current inventory's slot 8 to 1 of pink stained glass pane of lure 10 named "Pusty slot na rzuty"
  231. set {_p}'s current inventory's slot 9 to 1 of pink stained glass pane of lure 10 named "Pusty slot na rzuty"
  232. set {_p}'s current inventory's slot 10 to 1 of black stained glass pane named " "
  233. set {_p}'s current inventory's slot 11 to 1 of black stained glass pane named " "
  234. set {_p}'s current inventory's slot 12 to 1 of black stained glass pane named " "
  235. set {_p}'s current inventory's slot 13 to 1 of jukebox of knockback 10 named "&6&lRzuc Kostka!"
  236. set {_p}'s current inventory's slot 14 to 1 of black stained glass pane named " "
  237. set {_p}'s current inventory's slot 15 to 1 of black stained glass pane named " "
  238. set {_p}'s current inventory's slot 16 to 1 of black stained glass pane named " "
  239. set {_p}'s current inventory's slot 17 to 1 of pink stained glass pane of lure 10 named "Pusty slot na rzuty"
  240. set {_p}'s current inventory's slot 18 to 1 of pink stained glass pane of lure 10 named "Pusty slot na rzuty"
  241. set {_p}'s current inventory's slot 19 to 1 of black stained glass pane named " "
  242. set {_p}'s current inventory's slot 20 to 1 of black stained glass pane named " "
  243. set {_p}'s current inventory's slot 21 to 1 of black stained glass pane named " "
  244. set {_p}'s current inventory's slot 22 to 1 of light green stained glass pane named "&2&lWyrzucone oczka"
  245. set {_p}'s current inventory's slot 23 to 1 of black stained glass pane named " "
  246. set {_p}'s current inventory's slot 24 to 1 of black stained glass pane named " "
  247. set {_p}'s current inventory's slot 25 to 1 of black stained glass pane named " "
  248. set {_p}'s current inventory's slot 26 to 1 of pink stained glass pane of lure 10 named "Pusty slot na rzuty"
  249. set {_p}'s current inventory's slot 27 to 1 of pink stained glass pane of lure 10 named "Pusty slot na rzuty"
  250. set {_p}'s current inventory's slot 28 to 1 of black stained glass pane named " "
  251. set {_p}'s current inventory's slot 29 to 4 of {oczko.glowa::4} named " "
  252. set {_p}'s current inventory's slot 30 to 5 of {oczko.glowa::5} named " "
  253. set {_p}'s current inventory's slot 31 to 6 of {oczko.glowa::6} named " "
  254. set {_p}'s current inventory's slot 32 to 1 of {oczko.glowa::1} named " "
  255. set {_p}'s current inventory's slot 33 to 2 of {oczko.glowa::2} named " "
  256. set {_p}'s current inventory's slot 34 to 1 of black stained glass pane named " "
  257. set {_p}'s current inventory's slot 35 to 1 of pink stained glass pane of lure 10 named "Pusty slot na rzuty"
  258. set {_p}'s current inventory's slot 36 to 1 of pink stained glass pane of lure 10 named "Pusty slot na rzuty"
  259. set {_p}'s current inventory's slot 37 to 1 of black stained glass pane named " "
  260. set {_p}'s current inventory's slot 38 to 1 of black stained glass pane named " "
  261. set {_p}'s current inventory's slot 39 to 1 of {oczko.glowa::1} named " "
  262. set {_p}'s current inventory's slot 40 to 2 of {oczko.glowa::2} named " "
  263. set {_p}'s current inventory's slot 41 to 3 of {oczko.glowa::3} named " "
  264. set {_p}'s current inventory's slot 42 to 1 of black stained glass pane named " "
  265. set {_p}'s current inventory's slot 43 to 1 of black stained glass pane named " "
  266. set {_p}'s current inventory's slot 44 to 1 of pink stained glass pane of lure 10 named "Pusty slot na rzuty"
  267. set {_p}'s current inventory's slot 45 to 1 of pink stained glass pane of lure 10 named "Pusty slot na rzuty"
  268. if {_gry} = 0:
  269. set {_p}'s current inventory's slot 46 to 1 of black stained glass pane named " "
  270. else:
  271. set {_p}'s current inventory's slot 46 to {_gry} of beacon named "&a&lWygrano: %{_gry}%/3"
  272. set {_p}'s current inventory's slot 47 to 1 of black stained glass pane named " "
  273. set {_p}'s current inventory's slot 48 to 1 of black stained glass pane named " "
  274. set {_p}'s current inventory's slot 49 to 1 of light green stained glass pane named "&2&lWyrzucone oczka"
  275. set {_p}'s current inventory's slot 50 to 1 of black stained glass pane named " "
  276. set {_p}'s current inventory's slot 51 to 1 of black stained glass pane named " "
  277. set {_p}'s current inventory's slot 52 to 1 of 355:14 named "&4&lPasuj"
  278. set {_p}'s current inventory's slot 53 to 1 of pink stained glass pane of lure 10 named "Pusty slot na rzuty"
Advertisement
Add Comment
Please, Sign In to add comment