Advertisement
sirayasiki

ガチャ 改良

Aug 8th, 2023 (edited)
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.75 KB | None | 0 0
  1. on click:
  2. if event-item is stick named "inv1":
  3. set {inv.%uuid%} to 0
  4. if event-item is stick named "inv2":
  5. delete {inv.%uuid%}
  6.  
  7.  
  8. on inventory click:
  9. if {inv.%uuid%} is 0:
  10. if type of event-inventory is chest inventory:
  11. set {i.num} to the clicked slot
  12. send "チェストインベントリ&a%{i.num}%"
  13. if name of player's current inventory contain "%{shop::%{shop.set.%uuid%}%::name}%":
  14. cancel event
  15. if event-item is diamond named "商品設定":
  16. set {_shop} to chest with 6 row named "%{shop::%{shop.set.%uuid%}%::name}%&f:商品設定"
  17. loop 54 time:
  18. set slot loop-number - 1 of {_shop} to black stained glass pane named "&c未設定" with lore "クリックで設定"
  19. loop {shop::%{shop.set.%uuid%}%::*}:
  20. set slot loop-index parsed as number - 1 of {_shop} to loop-value
  21. open {_shop} to player
  22. if event-item is writable book named "&e&lショップの名前変更" with lore "&f現在:%{shop::%{shop.set.%uuid%}%::name}%":
  23. set {shop.n.%player%} to on
  24. send "&aガチャの名前をチャットに入力してください%{shop.n.%uuid%}%"
  25. close player's inventory
  26. if name of player's current inventory contain "%{shop::%{shop.set.%uuid%}%::name}%&f:商品設定":
  27. cancel event
  28. set {_num.s} to 0
  29. loop {shop::%{shop.set.%uuid%}%::*}:
  30. if {_num.s} < 55:
  31. add 1 to {_num.s}
  32. if {_num.s} >= 55:
  33. stop
  34. if event-item is {shop::%{shop.set.%uuid%}%::%{_num.s}%}:
  35. set {_i.n} to the clicked slot if name of player's current inventory contain "%{shop::%{shop.set.%uuid%}%::name}%&f:商品設定"
  36. open chest with 1 row named "%{shop::%{shop.set.%uuid%}%::name}%&f:商品設定:slot[%{_i.n}%]" to player
  37. if event-item is black stained glass pane named "&c未設定" with lore "クリックで設定":
  38. set {_i.n} to the clicked slot if name of player's current inventory contain "%{shop::%{shop.set.%uuid%}%::name}%&f:商品設定"
  39. open chest with 1 row named "%{shop::%{shop.set.%uuid%}%::name}%&f:商品設定:slot[%{_i.n}%]" to player
  40.  
  41.  
  42.  
  43. on chat:
  44. if {shop.n.%player%} is on:
  45. cancel event
  46. set {shop::%{shop.set.%uuid%}%::name} to the chat message
  47. set {shop.n.%uuid%} to off
  48. send "&eガチャの名前を&f[%{shop::%{shop.set.%uuid%}%::name}%&f]&eに変更しました"
  49. command /shop <num>:
  50. permission: op
  51. trigger:
  52. set {shop.set.%uuid%} to arg 1
  53. if {shop::%{shop.set.%uuid%}%::name} is not set:
  54. set {shop::%{shop.set.%uuid%}%::name} to "&5&l名称未設定の店"
  55. open chest with 1 row named "%{shop::%{shop.set.%uuid%}%::name}%" to player
  56. set slot 0 of player's current inventory to diamond named "商品設定"
  57. set slot 1 of player's current inventory to writable book named "&e&lショップの名前変更" with lore "&f現在:%{shop::%{shop.set.%uuid%}%::name}%"
  58.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement