Advertisement
sirayasiki

ガチャ 試作

Jul 29th, 2022 (edited)
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.88 KB | None | 0 0
  1. on right click:
  2. if player's tool is {gatya-item}:
  3. set {_gatya.%player%} to random integer between 1 and {gatya-num}
  4. send "%{_gatya.%player%}%"
  5. give {gatya::%{_gatya.%player%}%} to player
  6. if player's tool is stone named "2":
  7. send "%{gatya::*}%"
  8.  
  9. on left click:
  10. if player's tool is {gatya-item}:
  11. set {_gatya} to chest with 6 row named "&6&lガチャ景品一覧"
  12. loop {gatya::*}:
  13. set slot loop-index parsed as number - 1 of {_gatya} to loop-value
  14. open {_gatya} to player
  15.  
  16. command /gatya <text>:
  17. permission: op
  18. trigger:
  19. if arg 1 = "set":
  20. set {_gatya} to chest with 6 row named "&6&lガチャ景品設定"
  21. loop {gatya::*}:
  22. set slot loop-index parsed as number - 1 of {_gatya} to loop-value
  23. open {_gatya} to player
  24. if arg 1 is "list":
  25. set {_gatya} to chest with 6 row named "&6&lガチャ景品一覧"
  26. loop {gatya::*}:
  27. set slot loop-index parsed as number - 1 of {_gatya} to loop-value
  28. open {_gatya} to player
  29.  
  30. on inventory close:
  31. if name of event-inventory is "&6&lガチャ景品設定":
  32. set {_gatyanum} to 1
  33. set {gatya-num} to 0
  34. delete {gatya::*}
  35. loop 54 times:
  36. set {gatya::%{_gatyanum}%} to slot loop-number - 1 of event-inventory
  37. if {gatya::%{_gatyanum}%} is not air:
  38. add 1 to {_gatyanum}
  39. add 1 to {gatya-num}
  40. if {gatya::%{_gatyanum}%} is air:
  41. delete {gatya::%{_gatyanum}%}
  42. if name of event-inventory is "&e&lガチャアイテムを変更":
  43. set {gatya-item} to slot 4 of event-inventory
  44. if {gatya-item} is air:
  45. set {gatya-item} to chest named "%{gatya-name}%"
  46.  
  47. command /gatya1:
  48. permission: op
  49. trigger:
  50. open chest with 1 row named "&6&lガチャ設定" to player
  51. set slot 0 of player's current inventory to diamond named "&e&l景品設定"
  52. set slot 1 of player's current inventory to writable book named "&e&lガチャの名前変更" with lore "&f現在:%{gatya-name}%"
  53. set slot 2 of player's current inventory to chest named "&e&lガチャアイテム変更"
  54.  
  55. on inventory click:
  56. if name of player's current inventory contain "&6&lガチャ景品一覧":
  57. cancel event
  58. if name of player's current inventory contain "&6&lガチャ設定":
  59. cancel event
  60. if event-item is writable book named "&e&lガチャの名前変更" with lore "&f現在:%{gatya-name}%":
  61. set {.gatyanamesetting.%player%} to on
  62. send "&aガチャの名前をチャットに入力してください"
  63. close event-players's inventory
  64. if event-item is diamond named "&e&l景品設定":
  65. set {_gatya} to chest with 6 row named "&6&lガチャ景品設定"
  66. loop {gatya::*}:
  67. set slot loop-index parsed as number - 1 of {_gatya} to loop-value
  68. open {_gatya} to player
  69. if event-item is chest named "&e&lガチャアイテム変更":
  70. open chest with 1 row named "&6&lガチャアイテム変更" to player
  71. set slot 3 of player's current inventory to {gatya-item} named "&e&lガチャアイテムを変更"
  72. set slot 5 of player's current inventory to green stained glass pane named "&e&lガチャアイテムを入手"
  73. if name of player's current inventory contain "&6&lガチャアイテム変更":
  74. cancel event
  75. if event-item is {gatya-item} named "&e&lガチャアイテムを変更":
  76. open chest with 1 row named "&e&lガチャアイテムを変更" to player
  77. set slot 0 and 1,2,3,5,6,7,8 of player's current inventory to yellow stained glass pane named "&f真ん中においてね"
  78. set slot 4 of player's current inventory to {gatya-item}
  79. if event-item is green stained glass pane named "&e&lガチャアイテムを入手":
  80. give {gatya-item} to player
  81.  
  82. on chat:
  83. if {.gatyanamesetting.%player%} is on:
  84. cancel event
  85. set {gatya-name} to the chat message
  86. set {.gatyanamesetting.%player%} to off
  87. send "&eガチャの名前を&f[%{gatya-name}%&f]&eに変更しました"
  88.  
  89. on load:
  90. if {gatya-item} is not set:
  91. set {gatya-item} to chest named "&fガチャ"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement