Advertisement
namekuzi

Untitled

Apr 16th, 2021
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. on load:
  2. set {slm.r1} to polished granite
  3. set {slm.r2} to polished andesite
  4. set {slm.r3} to polished diorite
  5. set {slm.r4} to netherite block
  6. set {slm.r5} to packed ice block
  7. set {slm.r6} to gold block
  8. set {slm1.sound} to "block.note_block.cow_bell"
  9. set {token.small.name} to gold nugget named "&7Small Casino Token"
  10.  
  11. command /slot [<text>]:
  12. trigger:
  13. if player is not an op:
  14. stop
  15. if arg-1 is "reload":
  16. execute player command "/sk reload KK/SLM/SLM1"
  17. if arg-1 is "maker":
  18. give player 1 of paper named "&bSlot Maker"
  19. if arg-1 is "token":
  20. give player 64 of {token.small.name}
  21.  
  22. on right click on sign:
  23. if player's tool is paper named "&bSlot Maker":
  24. if line 1 of target block contain "slm":
  25. set {_name} to line 1 of target block
  26. send line 1 of target block to player
  27.  
  28. if line 2 of target block is "set":
  29. set {_type} to line 3 of target block
  30. set block at event-location to diamond block
  31. set {slm::%{_name}%::%{_type}%} to event-location
  32. send "%{slm::%{_name}%::%{_type}%}%" to player
  33. on region leave:
  34. set {_sections::*} to region at player
  35. set {_sections} to "%{_sections::*}%"
  36. set {_sections::*} to {_sections} split at " "
  37. loop {_sections::*}:
  38. if loop-value contain "slm":
  39. set {_temp} to loop-value
  40. if {_temp} contain "slm":
  41. set line 1 of block at {slm::%{_temp}%::sign} to ""
  42. clear {slm::%{_temp}%::player}
  43. set line 2 of block at {slm::%{_temp}%::sign} to "&1Bet : "
  44. clear {slm::%{_temp}%::bet}
  45.  
  46. on right click on button:
  47. set {_warning.area} to "%{casino.prefix}% &7>> Sorry, You are not in the area of &eSlot 1"
  48. set {_warning.working} to "%{casino.prefix}% &7>> Sorry, The machine is currently working."
  49. set {_warning.no.token} to "%{casino.prefix}% &7>> You don't have enough token to play this machine."
  50. set {_warning.register} to "%{casino.prefix}% &7>> You are registered to"
  51. set {_warning.warning} to "%{casino.prefix}% &7>> &cWarning!: &7Don't left the slot area until it finished. Otherwise, You will get &cnothing &7from the machine."
  52. set {_warning.register.name} to "%{casino.prefix}% &7>> This machine is registered to &c%{slm1.player}%"
  53.  
  54. set {_sections::*} to region at player
  55. set {_sections} to "%{_sections::*}%"
  56. set {_sections::*} to {_sections} split at " "
  57. loop {_sections::*}:
  58. if loop-value contain "slm":
  59. set {_temp} to loop-value
  60.  
  61. if {slm::%{_temp}%::player} is not set:
  62. set {slm::%{_temp}%::player} to player
  63. set line 1 of block at {slm::%{_temp}%::sign} to "&4%name of player%"
  64. send "%{_warning.register}% %{_temp}%" to player
  65. set {slm::%{_temp}%::bet} to 2
  66. set line 2 of block at {slm::%{_temp}%::sign} to "&1Bet : 2"
  67.  
  68. if {slm::%{_temp}%::player} is player:
  69. cancel event
  70. if location of target block is {slm::%{_temp}%::button1}:
  71. if {slm::%{_temp}%::active} is 1:
  72. stop
  73. if {slm::%{_temp}%::bet} > 2:
  74. set {slm::%{_temp}%::bet} to {slm::%{_temp}%::bet} - 1
  75. set line 2 of block at {slm::%{_temp}%::sign} to "&1Bet : %{slm::%{_temp}%::bet}%"
  76.  
  77. if location of target block is {slm::%{_temp}%::button3}:
  78. if {slm::%{_temp}%::active} is 1:
  79. stop
  80. if {slm::%{_temp}%::bet} < 10:
  81. set {slm::%{_temp}%::bet} to {slm::%{_temp}%::bet} + 1
  82. set line 2 of block at {slm::%{_temp}%::sign} to "&1Bet : %{slm::%{_temp}%::bet}%"
  83.  
  84. if location of target block is {slm::%{_temp}%::button2}:
  85.  
  86. if amount of {token.small.name} in player's inventory is less than {slm::%{_temp}%::bet}:
  87. send {_warning.no.token} to player
  88. stop
  89. if {slm::%{_temp}%::active} is 1:
  90. stop
  91.  
  92.  
  93. remove {slm::%{_temp}%::bet} of {token.small.name} from player
  94. set {_min} to 2
  95. set {_max} to 6
  96. set {_loop1} to a random integer between 15 and 25
  97. set {_loop2} to a random integer between 10 and 15
  98. set {_loop3} to a random integer between 10 and 15
  99. set {slm::%{_temp}%::active} to 1
  100. loop {_loop1} times:
  101. wait 0.1 second
  102. set {_random1} to a random integer between {_min} and {_max}
  103. set {_random2} to a random integer between {_min} and {_max}
  104. set {_random3} to a random integer between {_min} and {_max}
  105. set block at {slm::%{_temp}%::b1} to {slm.r%{_random1}%}
  106. set block at {slm::%{_temp}%::b2} to {slm.r%{_random2}%}
  107. set block at {slm::%{_temp}%::b3} to {slm.r%{_random3}%}
  108. play sound {slm1.sound} with volume 0.2 and pitch 1 at {slm::%{_temp}%::sign}
  109. loop {_loop2} times:
  110. wait 0.1 second
  111. set {_random2} to a random integer between {_min} and {_max}
  112. set {_random3} to a random integer between {_min} and {_max}
  113. set block at {slm::%{_temp}%::b2} to {slm.r%{_random2}%}
  114. set block at {slm::%{_temp}%::b3} to {slm.r%{_random3}%}
  115. if {_random1} = {_random2}:
  116. chance of 1%:
  117. set {_random2} to a random integer between {_min} and {_max}
  118. set block at {slm::%{_temp}%::b2} to {slm.r%{_random2}%}
  119. play sound {slm1.sound} with volume 0.2 and pitch 1.1 at {slm::%{_temp}%::sign}
  120. loop {_loop3} times:
  121. wait 0.2 second
  122. set {_random3} to a random integer between {_min} and {_max}
  123. set block at {slm::%{_temp}%::b3} to {slm.r%{_random3}%}
  124. if {_random2} = {_random3}:
  125. chance of 1%:
  126. set {_random3} to a random integer between {_min} and {_max}
  127. set block at {slm::%{_temp}%::b3} to {slm.r%{_random3}%}
  128. play sound {slm1.sound} with volume 0.2 and pitch 1.2 at {slm::%{_temp}%::sign}
  129.  
  130. play sound {slm1.sound} with volume 1 and pitch 1.3 at {slm::%{_temp}%::sign}
  131. set {slm::%{_temp}%::active} to 0
  132.  
  133. if {_random1} = {_random2}:
  134. if {_random2} = {_random3}:
  135. if {_random1} = 1:
  136. set {_reward} to 4
  137. if {_random1} = 2:
  138. set {_reward} to 8
  139. if {_random1} = 3:
  140. set {_reward} to 16
  141. if {_random1} = 4:
  142. set {_reward} to 32
  143. if {_random1} = 5:
  144. set {_reward} to 64
  145. broadcast "%{casino.prefix}% &7>> &e%player% &7has won a jackpot &ax%{_reward}%"
  146. set line 3 of block at {slm::%{_temp}%::sign} to "Raward : &4x%{_reward}%"
  147. else if {_random1} = {_random2}:
  148. if {_random2} != {_random3}:
  149. set {_reward} to 0.5
  150. else if {_random2} = {_random3}:
  151. if {_random1} != {_random2}:
  152. set {_reward} to 0.5
  153. else:
  154. set {_reward} to 0
  155.  
  156.  
  157. set {_total} to {slm::%{_temp}%::bet}*{_reward}
  158. give player {_total} of {token.small.name}
  159.  
  160. if block at {slm::%{_temp}%::b1} is {slm.r7}:
  161. give player {slm::%{_temp}%::bet}/2 of gold block
  162. if block at {slm::%{_temp}%::b2} is {slm.r7}:
  163. give player {slm::%{_temp}%::bet}/2 of gold block
  164. if block at {slm::%{_temp}%::b3} is {slm.r7}:
  165. give player {slm::%{_temp}%::bet}/2 of gold block
  166.  
  167.  
  168. else:
  169. stop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement