sirayasiki

お店-プロトタイプ

Nov 19th, 2023 (edited)
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.40 KB | None | 0 0
  1. #変数一覧
  2. #{shop.set.%player's uuid%}
  3. #ショップの編集時にどの番号のショップを変更するか決めるための物
  4.  
  5.  
  6. on click:
  7. if event-item is stick named "inv1":
  8. send "%{shop.set.%player's uuid%}%"
  9. if event-item is stick named "inv2":
  10. delete {inv.%player's uuid%}
  11. if event-item is stick named "shop3":
  12. send "%{shop.n.%player's uuid%}%"
  13.  
  14.  
  15. on inventory click:
  16.  
  17. if {inv.%player's uuid%} is 0:
  18. if type of event-inventory is chest inventory:
  19. set {i.num} to the clicked slot
  20. send "チェストインベントリ&a%{i.num}%"
  21. #スロットの番号をチャットで確認する構文 後で消しても大丈夫
  22. if name of player's current inventory contain "%{shop::%{shop.set.%player's uuid%}%::name}%":
  23. cancel event
  24. if event-item is diamond named "&b商品設定":
  25. set {_shop} to chest with 6 row named "%{shop::%{shop.set.%player's uuid%}%::name}%&f:商品設定"
  26. loop 54 time:
  27. set slot loop-number - 1 of {_shop} to black stained glass pane named "&c未設定" with lore "クリックで設定"
  28. loop {shop::%{shop.set.%player's uuid%}%::*}:
  29. set slot loop-index parsed as number - 1 of {_shop} to loop-value
  30. open {_shop} to player
  31. if event-item is writable book named "&e&lショップの名前変更" with lore "&f現在:%{shop::%{shop.set.%player's uuid%}%::name}%":
  32. set {shop.n.%player%} to true
  33. send "&aショップの名前をチャットに入力してください"
  34. close player's inventory
  35. if name of player's current inventory contain "%{shop::%{shop.set.%player's uuid%}%::name}%&f:商品設定":
  36. cancel event
  37. set {_num.s} to 0
  38. loop {shop::%{shop.set.%player's uuid%}%::item::*}:
  39. if {_num.s} < 55:
  40. add 1 to {_num.s}
  41. if {_num.s} >= 55:
  42. stop
  43. if event-item is {shop::%{shop.set.%player's uuid%}%::item::%{_num.s}%}:
  44. set {i.n.%player%} to the clicked slot's index
  45. open chest with 1 row named "%{shop::%{shop.set.%player's uuid%}%::name}%&f:商品設定:slot[&a%{i.n.%player%}%&f]" to player
  46. set slot 2 of player's current inventory to emerald named "&a品物を設定"
  47. set slot 6 of player's current inventory to gold ingot named "&6金額を設定"
  48. if event-item is black stained glass pane named "&c未設定" with lore "クリックで設定":
  49. set {i.n.%player%} to the clicked slot's index
  50. open chest with 1 row named "%{shop::%{shop.set.%player's uuid%}%::name}%&f:商品設定:slot[&a%{i.n.%player%}%&f]" to player
  51. set slot 2 of player's current inventory to emerald named "&a品物を設定"
  52. set slot 6 of player's current inventory to gold ingot named "&6金額を設定"
  53. if name of player's current inventory contain "%{shop::%{shop.set.%player's uuid%}%::name}%&f:商品設定:slot[&a%{i.n.%player%}%&f]":
  54. if event-item is emerald:
  55. open chest with 1 row named "%{shop::%{shop.set.%player's uuid%}%::name}%&f:品物を設定:slot[&a%{i.n.%player%}%&f]" to player
  56. set slot 0 and 1,2,3,5,6,7,8 of player's current inventory to yellow stained glass pane named "&f中心にアイテムをセット"
  57. if event-item is gold ingot:
  58. open chest with 4 row named "%{shop::%{shop.set.%player's uuid%}%::name}%&f:金額を設定:slot[&a%{i.n.%player%}%&f]" to player
  59.  
  60.  
  61. on inventory close:
  62. if name of event-inventory is "%{shop::%{shop.set.%player's uuid%}%::name}%&f:品物を設定:slot[&a%{i.n.%player%}%&f]":
  63. set {_set.item} to slot 4 of event-inventory
  64. if {_set.item} is not air:
  65. set {shop::%{shop.set.%player's uuid%}%::item::%{i.n.%player%}%} to slot 4 of event-inventory
  66.  
  67.  
  68.  
  69.  
  70. on chat:
  71. if {shop.n.%player%} = true:
  72. cancel event
  73. set {shop::%{shop.set.%player's uuid%}%::name} to the chat message
  74. set {shop.n.%player%} to false
  75. send "&eガチャの名前を&f[%{shop::%{shop.set.%player's uuid%}%::name}%&f]&eに変更しました"
  76. stop
  77. else:
  78. set {shop.n.%player%} to false
  79.  
  80. command /shop <num>:
  81. permission: op
  82. trigger:
  83. set {shop.set.%player's uuid%} to arg 1
  84. if {shop::%{shop.set.%player's uuid%}%::name} is not set:
  85. set {shop::%{shop.set.%player's uuid%}%::name} to "&5&l名称未設定の店"
  86. open chest with 1 row named "%{shop::%{shop.set.%player's uuid%}%::name}%" to player
  87. set slot 0 of player's current inventory to diamond named "&b商品設定"
  88. set slot 1 of player's current inventory to writable book named "&e&lショップの名前変更" with lore "&f現在:%{shop::%{shop.set.%player's uuid%}%::name}%"
  89.  
Advertisement
Add Comment
Please, Sign In to add comment