Advertisement
kama6012

GUI Shop

Mar 20th, 2019
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.67 KB | None | 0 0
  1. on load:
  2. set {shop::ATM} to "ATM"
  3. set {shop::ATM::18} to 1 red glass pane named "&6Aを預ける"
  4. set {shop::ATM::19} to 1 iron nugget named "&r1Aを預ける"
  5. set {shop::ATM::19::A} to {importitem::1A}
  6. set {shop::ATM::19::B} to 1
  7. set {shop::ATM::27} to 1 green glass pane named "&6Aを引き出す"
  8. set {shop::ATM::28} to 1 iron nugget named "&r1Aを引き出す"
  9. set {shop::ATM::28::A} to 1
  10. set {shop::ATM::28::B} to {importitem::1A}
  11. set {shop::test} to "TEST"
  12. set {shop::test::0} to 1 diamond with lore "コンパスでダイヤを探すマン"
  13. set {shop::test::0::A} to 1 compass
  14. set {shop::test::0::B} to 1 diamond
  15. set {shop::test::9} to 1 compass named "丸石"
  16. set {shop::test::9::A} to 1 cobblestone
  17. set {shop::test::9::B} to 1 compass
  18. set {shop::test::1} to 1 wooden sword named "&r木の大剣" with lore "&r1A"
  19. set {shop::test::1::A} to 1
  20. set {shop::test::1::B} to {importitem::0}
  21.  
  22. on rightclick on villager:
  23. name of event-entity contain "&k&r"
  24. cancel event
  25. loop {shop::*}:
  26. name of event-entity contain loop-value
  27. set {_shopname} to loop-index
  28. open chest with 4 rows named {_shopname} to player
  29. wait 1 tick
  30. loop {shop::%{_shopname}%::*}:
  31. set {_slot} to loop-index
  32. set {_item} to loop-value
  33. set {_buy} to "buy %player% %{_shopname}% %{_slot}%"
  34. format slot {_slot} parsed as number of player with {_item} to run {_buy}
  35.  
  36. command /buy <player> <text> <number>:
  37. trigger:
  38. {shop::%arg 2%::%arg 3%::A} is item or number
  39. {shop::%arg 2%::%arg 3%::B} is item or number
  40. if {shop::%arg 2%::%arg 3%::A} is item:
  41. arg 1 has {shop::%arg 2%::%arg 3%::A}
  42. remove {shop::%arg 2%::%arg 3%::A} from arg 1's inventory
  43. if {shop::%arg 2%::%arg 3%::B} is item:
  44. give arg-1 {shop::%arg 2%::%arg 3%::B}
  45. else if {shop::%arg 2%::%arg 3%::B} is number:
  46. set {money::%arg 1%} to {money::%arg 1%} + {shop::%arg 2%::%arg 3%::B}
  47. else if {shop::%arg 2%::%arg 3%::A} is number:
  48. {money::%arg 1%} >= {shop::%arg 2%::%arg 3%::A}
  49. set {money::%arg 1%} to {money::%arg 1%} - {shop::%arg 2%::%arg 3%::A}
  50. if {shop::%arg 2%::%arg 3%::B} is item:
  51. give arg-1 {shop::%arg 2%::%arg 3%::B}
  52. else if {shop::%arg 2%::%arg 3%::B} is number:
  53. set {money::%arg 1%} to {money::%arg 1%} + {shop::%arg 2%::%arg 3%::B}
  54.  
  55. command /import [<text>]:
  56. trigger:
  57. player's name is "Cat_Blacky_710" or "kama6012"
  58. if arg is "list":
  59. message "%{importitem::*}%"
  60. else:
  61. if arg exist:
  62. set {importitem::%arg%} to player's tool
  63. else:
  64. set {importitem::*} to player's tool
  65.  
  66. on first join:
  67. set {money::%player%} to 0
  68.  
  69. command /money [<text>] [<text>]:
  70. trigger:
  71. if arg 1 is "check":
  72. message "%{money::%player%}%" to player
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement