Guest User

Untitled

a guest
May 8th, 2016
431
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.13 KB | None | 0 0
  1. #---------------#
  2. # Autor: Gorlik1337
  3. # Link do Projektu na MPCForum.pl: http://www.mpcforum.pl/topic/1540068-ruletkag1337-ruletka-na-tw%C3%B3j-serwer-minecraft
  4. # Zakaz podszywania siÄ™
  5. # Wersja: 1.0
  6. #---------------#
  7.  
  8. options:
  9. green_icon: light green dye
  10. black_icon: gunpowder
  11. red_icon: redstone
  12. green_name: &2Zielony
  13. black_name: &8Czarny
  14. red_name: &cCzerwony
  15. klucz: 1234
  16. czas: 30
  17.  
  18. #kod
  19.  
  20. variables:
  21. {ruletka.red.%player%} = 0
  22. {ruletka.green.%player%} = 0
  23. {ruletka.black.%player%} = 0
  24. {ruletka.ktosgra} = false
  25.  
  26.  
  27. command /ruletka [<text>] [<player>] [<text>]:
  28. trigger:
  29. wait 2 tick
  30. if arg 1 is not set:
  31. open chest with 5 rows named "&1&lRuletka &7by Gorlik1337" to player
  32. set {ruletka.aktualizacja.%player%} to true
  33. execute player command "ruletka {@klucz} %player% autoaktualizacja"
  34.  
  35. if arg 1 is "{@klucz}":
  36. if arg 3 is "autoaktualizacja":
  37. while {ruletka.aktualizacja.%player%} is true:
  38. set {_money} to player's balance
  39. format slot 0 of player-arg with {ruletka.czas} of clock named "&6Czas &c%{ruletka.czas}%" to be unstealable
  40. format slot 2 of player-arg with {ruletka.red.%player-arg%} of {@red_icon} named "{@red_name} &7[&6%{ruletka.red.%player-arg%}%&7]" with lore "&7Postaw na {@red_name}" to run [execute player command "ruletka {@klucz} %player-arg% addred"]
  41. format slot 4 of player-arg with {ruletka.green.%player-arg%} of {@green_icon} named "{@green_name} &7[&6%{ruletka.green.%player-arg%}%&7]" with lore "&7Postaw na {@green_name}" to run [execute player command "ruletka {@klucz} %player-arg% addgreen"]
  42. format slot 6 of player-arg with {ruletka.black.%player-arg%} of {@black_icon} named "{@black_name} &7[&6%{ruletka.black.%player-arg%}%&7]" with lore "&7Postaw na {@black_name}" to run [execute player command "ruletka {@klucz} %player-arg% addblack"]
  43. format slot 8 of player-arg with 1 of paper named "&6Stan konta" with lore "&6%{_money}%" to be unstealable
  44. if {ruletka.losuje} is false:
  45. format slot 22 of player-arg with 1 of hopper named "&7Oczekiwanie na koniec czasu..." to be unstealable
  46. if {ruletka.losuje} is true:
  47. format slot 22 of player-arg with 1 of hopper named "&7Trwa Losowanie..." to be unstealable
  48. loop 9 times:
  49. if {ruletka.slot.%loop-number%} is "red":
  50. format slot loop-number+26 of player-arg with 1 of {@red_icon} named "{@red_name}" to be unstealable
  51. if {ruletka.slot.%loop-number%} is "green":
  52. format slot loop-number+26 of player-arg with 1 of {@green_icon} named "{@green_name}" to be unstealable
  53. if {ruletka.slot.%loop-number%} is "black":
  54. format slot loop-number+26 of player-arg with 1 of {@black_icon} named "{@black_name}" to be unstealable
  55. wait tick
  56.  
  57. if arg 3 is "addred":
  58. if {ruletka.losuje} is false:
  59. if player-arg's balance is greater than or equal to 1:
  60. remove 1 from player's balance
  61. add 1 to {ruletka.red.%player-arg%}
  62. play raw sound "random.pop" at player-arg with pitch 1 volume 1
  63. set {ruletka.ktosgra} to true
  64. stop
  65. play raw sound "random.pop" at player-arg with pitch 0 volume 1
  66. stop
  67. if arg 3 is "addgreen":
  68. if {ruletka.losuje} is false:
  69. if player-arg's balance is greater than or equal to 1:
  70. remove 1 from player's balance
  71. add 1 to {ruletka.green.%player-arg%}
  72. play raw sound "random.pop" at player-arg with pitch 1 volume 1
  73. set {ruletka.ktosgra} to true
  74. stop
  75. play raw sound "random.pop" at player-arg with pitch 0 volume 1
  76. stop
  77. if arg 3 is "addblack":
  78. if {ruletka.losuje} is false:
  79. if player-arg's balance is greater than or equal to 1:
  80. remove 1 from player's balance
  81. add 1 to {ruletka.black.%player-arg%}
  82. play raw sound "random.pop" at player-arg with pitch 1 volume 1
  83. set {ruletka.ktosgra} to true
  84. stop
  85. play raw sound "random.pop" at player-arg with pitch 0 volume 1
  86. stop
  87.  
  88.  
  89. every 1 second:
  90. if {ruletka.czas} is greater than 0:
  91. remove 1 from {ruletka.czas}
  92. stop
  93. if {ruletka.czas} is 0:
  94. set {ruletka.losuje} to true
  95. if {ruletka.losuje} is true:
  96. if {ruletka.uruchom_losowanie} is false:
  97. if {ruletka.ktosgra} is false:
  98. set {ruletka.czas} to {@czas}
  99. set {ruletka.losuje} to false
  100. set {ruletka.uruchom_losowanie} to false
  101. stop
  102. set {ruletka.uruchom_losowanie} to true
  103. set {_random} to random integer between 20 and 30
  104. wait 1 seconds
  105. loop {_random} times:
  106. if loop-number > 15:
  107. loop loop-number - 12 times:
  108. wait 1 tick
  109. else:
  110. wait 3 tick
  111. set {_slot} to {ruletka.slot.1}
  112. loop 8 times:
  113. set {ruletka.slot.%loop-number-2%} to {ruletka.slot.%loop-number-2 + 1%}
  114. set {ruletka.slot.9} to {_slot}
  115. wait 1 seconds
  116. loop all players:
  117. if {ruletka.slot.5} is "green":
  118. set {ruletka.green.%loop-player%} to {ruletka.green.%loop-player%}*14
  119. add {ruletka.green.%loop-player%} to loop-player's balance
  120. if {ruletka.slot.5} is "red":
  121. set {ruletka.red.%loop-player%} to {ruletka.red.%loop-player%}*2
  122. add {ruletka.red.%loop-player%} to loop-player's balance
  123. if {ruletka.slot.5} is "black":
  124. set {ruletka.black.%loop-player%} to {ruletka.black.%loop-player%}*2
  125. add {ruletka.black.%loop-player%} to loop-player's balance
  126.  
  127. set {ruletka.green.%loop-player%} to 0
  128. set {ruletka.red.%loop-player%} to 0
  129. set {ruletka.black.%loop-player%} to 0
  130. wait 3 seconds
  131. set {ruletka.czas} to {@czas}
  132. set {ruletka.losuje} to false
  133. set {ruletka.uruchom_losowanie} to false
  134. stop
  135.  
  136.  
  137.  
  138. on inventory close:
  139. if {ruletka.aktualizacja.%player%} is true:
  140. set {ruletka.aktualizacja.%player%} to false
  141.  
  142. on script load:
  143. set {ruletka.czas} to {@czas}
  144. set {ruletka.losuje} to false
  145. set {ruletka.uruchom_losowanie} to false
  146. set {ruletka.slot.1} to "green"
  147. set {ruletka.slot.2} to "red"
  148. set {ruletka.slot.3} to "black"
  149. set {ruletka.slot.4} to "red"
  150. set {ruletka.slot.5} to "black"
  151. set {ruletka.slot.6} to "red"
  152. set {ruletka.slot.7} to "black"
  153. set {ruletka.slot.8} to "red"
  154. set {ruletka.slot.9} to "black"
Advertisement
Add Comment
Please, Sign In to add comment