7mm

Skript: handyCasino

7mm
Feb 17th, 2019
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.83 KB | None | 0 0
  1. on join:
  2. message "&e[HandyCasino]"
  3. message "&6/coinbutton でまずはお金を貯めましょう!"
  4. message "&c5コイン貯めたらまずは /uod 5 をしてみましょう!"
  5.  
  6. command /coinbutton:
  7. trigger:
  8. give stone button named "&eCoin&7Button" to player
  9. message "&9&l20回押すごとに1コイン支給されます"
  10.  
  11. on rightclick:
  12. if name of player's held item is "&eCoin&7Button":
  13. if {handycasino::%player%::coinbuttonct} > 0:
  14. set {handycasino::%player%::coinbuttonct} to 2
  15. stop
  16. set {handycasino::%player%::coinbuttonct} to 2
  17. add 1 to {handycasino::%player%::coinbutton}
  18. if {handycasino::%player%::coinbutton} > 19:
  19. message "&e&lGet 1 Coin!"
  20. command "execute %player% ~ ~ ~ playsound entity.player.levelup master @a ~ ~ ~ 1 2"
  21. add 1 to {handycasino::%player%::coin}
  22. set {handycasino::%player%::coinbutton} to 0
  23.  
  24. every tick:
  25. loop all players:
  26. if {handycasino::%loop-player%::coinbuttonct} > 0:
  27. remove 1 from {handycasino::%loop-player%::coinbuttonct}
  28. if {handycasino::%loop-player%::coin} is not set:
  29. set {handycasino::%loop-player%::coin} to 0
  30.  
  31. on place:
  32. if name of player's held item is "&eCoin&7Button":
  33. cancel event
  34.  
  35. command /uod <integer>:
  36. trigger:
  37. if arg 1 < 5:
  38. message "&c5枚以上で賭けてください"
  39. stop
  40. if arg 1 > 100:
  41. message "&c100枚以下で賭けてください"
  42. stop
  43. if {handycasino::%player%::coin} < arg 1:
  44. message "&cコインが足りない為開始できませんでした"
  45. stop
  46. remove arg 1 from {handycasino::%player%::coin}
  47. set {_kakekin} to arg 1
  48. message "&c&lUP &6or &9&lDOWN"
  49. message "&7現在値(1~100)が&bランダム&7で表示されるので、"
  50. message "&7次に出るランダムな値(比較値)がそれより&c上&l(UP)&7か&9下&l(DOWN)&7かを予想します"
  51. message "&7成功すれば&6掛け金が&l二倍&7になり、失敗すれば&l全て消えます"
  52. message "&7現在値と比較値が同じ場合は確定で成功になります"
  53. message "&7現在賭け金: &b&l%{_kakekin}%"
  54. set {_rnd} to random integer between 1 to 100
  55. while true:
  56. set {_kakekin} to {_kakekin}*2
  57. set {_rnd2} to random integer between 1 to 100
  58. message "&7現在値: &a&l%{_rnd}%"
  59. message "&c&lUP &6or &9&lDOWN&7?"
  60. message "&c&lUP &7>> &c//u"
  61. message "&9&lDOWN &7>> &9//d"
  62. while true:
  63. if {handycasino::%player%::flag} is "u":
  64. if {_rnd} > {_rnd2}:
  65. set {_result} to 0
  66. else:
  67. set {_result} to 1
  68. exit loop
  69. if {handycasino::%player%::flag} is "d":
  70. if {_rnd} < {_rnd2}:
  71. set {_result} to 0
  72. else:
  73. set {_result} to 1
  74. exit loop
  75. wait a tick
  76. clear {handycasino::%player%::flag}
  77. message "&e&l比較値&7: &a&l%{_rnd2}%"
  78. if {_result} is not 1:
  79. set {_kakekin} to {_kakekin}/2
  80. message "&c&l賭 け 失 敗 !"
  81. message "&c%{_kakekin}%Gは得られませんでした"
  82. message "&6ゲームを終了します"
  83. exit loop
  84. message "&a&l賭 け 成 功 !"
  85. message "&7現在賭け金: &b&l%{_kakekin}%"
  86. message "&e&lContinue &7>> &e//c"
  87. message "&b&lExit &7>> &b//e"
  88. while true:
  89. if {handycasino::%player%::flag} is "c":
  90. exit loop
  91. if {handycasino::%player%::flag} is "e":
  92. set {_break} to true
  93. add {_kakekin} to {handycasino::%player%::coin}
  94. message "&a%{_kakekin}%Gを得ました"
  95. message "&6ゲームを終了します"
  96. exit loop
  97. wait a tick
  98. clear {handycasino::%player%::flag}
  99. if {_break} is true:
  100. exit loop
  101. set {_rnd} to {_rnd2}
  102.  
  103. command //c:
  104. trigger:
  105. set {handycasino::%player%::flag} to "c"
  106.  
  107. command //e:
  108. trigger:
  109. set {handycasino::%player%::flag} to "e"
  110.  
  111. command //u:
  112. trigger:
  113. set {handycasino::%player%::flag} to "u"
  114.  
  115. command //d:
  116. trigger:
  117. set {handycasino::%player%::flag} to "d"
Add Comment
Please, Sign In to add comment