Guest User

Help D:

a guest
Aug 26th, 2021
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.06 KB | None | 0 0
  1. command /shop [<text>]:
  2. trigger:
  3. open virtual chest inventory with size 6 named "&cShop" to player
  4. wait 2 tick
  5. set {_slot} to 0
  6. loop 54 times:
  7. format gui slot {_slot} of player with gray glass named "&7"
  8. add 1 to {_slot}
  9. format gui slot 10 of player with grass named "&2&lBlocks" to run player command "/shop blocks"
  10. format gui slot 12 of player with redstone named "&c&lRedstone" to run player command "/shop redstone"
  11. format gui slot 14 of player with seeds named "&a&LCrops" to run player command "/shop crops"
  12. format gui slot 16 of player with water bucket named "&3&lMiscellaneous" to run player command "/shop mis"
  13. format gui slot 20 of player with diamond named "&b&lMinerals" to run player command "/shop minerals"
  14. format gui slot 22 of player with mob_spawner named "&8&lSpawners" to run player command "/shop spawners"
  15. format gui slot 24 of player with dispenser named "&7&lMachines" to run player command "/shop machines"
  16. format gui slot 40 of player with blaze rod named "&6&LSell Wands" to run player command "/shop wands"
  17. if arg-1 is "blocks":
  18. open virtual chest inventory with size 6 named "&2&lBlocks (Basics)" to player
  19. wait 2 tick
  20. set {_slot} to 0
  21. loop 54 times:
  22. format gui slot {_slot} of player with gray glass named "&7"
  23. add 1 to {_slot}
  24. format gui slot 10 of player with 64 grass named "&7Grass" with lore "&c$150" to run function buyItem(player, 150, grass)
  25. format gui slot 11 of player with 64 dirt named "&7Dirt" with lore "&c$100" to run function buyItem(player, 100, dirt)
  26. format gui slot 12 of player with 64 stone named "&7Stone" with lore "&c$150" to run function buyItem(player, 150, 1:0)
  27. format gui slot 13 of player with 64 cobble_stone named "&7Cobblestone" with lore "&c$100" to run function buyItem(player, 100, 4)
  28. format gui slot 14 of player with 64 mossy_cobble_stone named "&7Mossy Cobblestone" with lore "&c$250" to run function buyItem(player, 250, 48)
  29. format gui slot 15 of player with 64 mossy_stone_bricks named "&7Mossy Stone Bricks" with lore "&c$500" to run function buyItem(player, 500, 98:1)
  30. format gui slot 16 of player with 64 gravel named "&7Gravel" with lore "&c$150" to run function buyItem(player, 150, gravel)
  31. format gui slot 19 of player with 64 sand named "&7Sand" with lore "&c$150" to run function buyItem(player, 150, sand)
  32. format gui slot 20 of player with 64 sand stone named "&7Sandstone" with lore "&c$200" to run function buyItem(player, 200, sandstone)
  33. format gui slot 21 of player with 64 smooth sandstone named "&7Sooth Sandstone" with lore "&c$200" to run function buyItem(player, 200, 24:2)
  34. format gui slot 22 of player with 64 chiseled sandstone named "&7Chiseled Sandstone" with lore "&c$200" to run function buyItem(player, 200, 24:1)
  35. format gui slot 23 of player with 64 redsand named "&7Red Sand" with lore "&c$250" to run function buyItem(player, 250, 12:1)
  36. format gui slot 24 of player with 64 red sandstone named "&7Red Sandstone" with lore "&c$400" to run function buyItem(player, 400, 179)
  37. format gui slot 25 of player with 64 smooth red sandstone named "&7Smooth Red Sandstone" with lore "&c$300" to run function buyItem(player, 300, 179:2)
  38. format gui slot 28 of player with 64 chiseled red sandstone named "&7Chiseled Red Sand" with lore "&c$400" to run function buyItem(player, 400, 179:1)
  39. format gui slot 29 of player with 64 snow named "&7Snow" with lore "&c$200" to run function buyItem(player, 200, 80)
  40. format gui slot 30 of player with 64 ice named "&7Ice" with lore "&c$150" to run function buyItem(player, 150, ice)
  41. format gui slot 31 of player with 64 packed ice named "&7Packed Ice" with lore "&c$6000" to run function buyItem(player, 6000, 174)
  42. format gui slot 32 of player with 64 ender_stone named "&7Endstone" with lore "&c$500" to run function buyItem(player, 500, 121)
  43. format gui slot 33 of player with 64 obsidian named "&7Obsidian" with lore "&c$350" to run function buyItem(player, 350, obsidian)
  44. format gui slot 34 of player with 64 netherrack named "&7Netherrack" with lore "&c$50" to run function buyItem(player, 50, netherrack)
  45. format gui slot 37 of player with 64 soul sand named "&7Soul Sand" with lore "&c$150" to run function buyItem(player, 150, 88)
  46. format gui slot 38 of player with 64 quartz_block named "&7Quartz Block" with lore "&c$200" to run function buyItem(player, 200, 155)
  47. format gui slot 39 of player with 64 chiselled quartz block named "&7Chiseled Quartz Block" with lore "&c$300" to run function buyItem(player, 300, 155:1)
  48. format gui slot 45 of player with 1 barrier named "&cClick to go Back" to run player command "/shop"
  49. format gui slot 53 of player with 1 arrow named "&cClick to go to Wools" to run player command "/shop blocksw"
  50. if arg-1 is "blocksw":
  51. open virtual chest inventory with size 6 named "&2&lBlocks (Wools)" to player
  52. wait 2 tick
  53. set {_slot} to 0
  54. loop 54 times:
  55. format gui slot {_slot} of player with gray glass named "&7"
  56. add 1 to {_slot}
  57. format gui slot 10 of player with 64 white_wool_blocks named "&7White Wool" with lore "&c$300" to run function buyItem(player, 300, 35)
  58. format gui slot 11 of player with 64 orange_wool_blocks named "&7Orange Wool" with lore "&c$500" to run function buyItem(player, 500, 35:1)
  59. format gui slot 12 of player with 64 magenta_wool_blocks named "&7Magenta Wool" with lore "&c$500" to run function buyItem(player, 500, 35:2)
  60. format gui slot 13 of player with 64 light_blue_wool_blocks named "&7Light Blue Wool" with lore "&c$500" to run function buyItem(player, 500, 35:3)
  61. format gui slot 14 of player with 64 yellow_wool_blocks named "&7Yellow Wool" with lore "&c$500" to run function buyItem(player, 500, 35:4)
  62. format gui slot 15 of player with 64 light_green_wool_blocks named "&7Lime Wool" with lore "&c$500" to run function buyItem(player, 500, 35:5)
  63. format gui slot 16 of player with 64 pink_wool_blocks named "&7Pink Wool" with lore "&c$500" to run function buyItem(player, 500, 35:6)
  64. format gui slot 19 of player with 64 gray_wool_blocks named "&7Gray Wool" with lore "&c$500" to run function buyItem(player, 500, 35:7)
  65. format gui slot 20 of player with 64 light_gray_wool_blocks named "&7Light Gray Wool" with lore "&c$500" to run function buyItem(player, 500, 35:8)
  66. format gui slot 21 of player with 64 cyan_wool_blocks named "&7Cyan Wool" with lore "&c$500" to run function buyItem(player, 500, 35:9)
  67. format gui slot 22 of player with 64 purple_wool_blocks named "&7Purple Wool" with lore "&c$500" to run function buyItem(player, 500, 35:10)
  68. format gui slot 23 of player with 64 blue_wool_blocks named "&7Blue Wool" with lore "&c$500" to run function buyItem(player, 500, 35:11)
  69. format gui slot 24 of player with 64 brown_wool_blocks named "&7Brown Wool" with lore "&c$500" to run function buyItem(player, 500, 35:12)
  70. format gui slot 25 of player with 64 green_wool_blocks named "&7Green Wool" with lore "&c$500" to run function buyItem(player, 500, 35:13)
  71. format gui slot 28 of player with 64 red_wool_blocks named "&7Red Wool" with lore "&c$500" to run function buyItem(player, 500, 35:14)
  72. format gui slot 29 of player with 64 black_wool_blocks named "&7Black Wool" with lore "&c$500" to run function buyItem(player, 500, 35:15)
  73. format gui slot 45 of player with 1 barrier named "&cClick to go Back" to run player command "/shop blocks"
  74. format gui slot 53 of player with 1 arrow named "&cClick to go to Clays" to run player command "/shop blocksc"
  75. if arg-1 is "blocksc":
  76. open virtual chest inventory with size 6 named "&2&lBlocks (Clays)" to player
  77. wait 2 tick
  78. set {_slot} to 0
  79. loop 54 times:
  80. format gui slot {_slot} of player with gray glass named "&7"
  81. add 1 to {_slot}
  82. format gui slot 10 of player with 64 clay_block named "&7Clay" with lore "&c$600" to run function buyItem(player, 600, 82)
  83. format gui slot 11 of player with 64 white_terracotta named "&7White Stained Clay" with lore "&c$1000" to run function buyItem(player, 1000, 159)
  84. format gui slot 12 of player with 64 orange_terracotta named "&7Orange Stained Clay" with lore "&c$1000" to run function buyItem(player, 1000, 159:1)
  85. format gui slot 13 of player with 64 magenta_terracotta named "&7Magenta Stained Clay" with lore "&c$1000" to run function buyItem(player, 1000, 159:2)
  86. format gui slot 14 of player with 64 light_blue_terracotta named "&7Light Blue Stained Clay" with lore "&c$1000" to run function buyItem(player, 1000, 159:3)
  87. format gui slot 15 of player with 64 yellow_terracotta named "&7Yellow Clay" with lore "&c$1000" to run function buyItem(player, 1000, 159:4)
  88. format gui slot 16 of player with 64 light_green_terracotta named "&7Lime Stained Clay" with lore "&c$1000" to run function buyItem(player, 1000, 159:5)
  89. format gui slot 19 of player with 64 pink_terracotta named "&7Pink Stained Clay" with lore "&c$1000" to run function buyItem(player, 1000, 159:6)
  90. format gui slot 20 of player with 64 gray_terracotta named "&7Gray Stained Clay" with lore "&c$1000" to run function buyItem(player, 1000, 159:7)
  91. format gui slot 21 of player with 64 light_gray_terracotta named "&7Light Gray Stained Clay" with lore "&c$1000" to run function buyItem(player, 1000, 159:8)
  92. format gui slot 22 of player with 64 cyan_terracotta named "&7Cyan Stained Clay" with lore "&c$1000" to run function buyItem(player, 1000, 159:9)
  93. format gui slot 23 of player with 64 purple_terracotta named "&7Purple Stained Clay" with lore "&c$1000" to run function buyItem(player, 1000, 159:10)
  94. format gui slot 24 of player with 64 blue_terracotta named "&7Blue Stained Clay" with lore "&c$1000" to run function buyItem(player, 1000, 159:11)
  95. format gui slot 25 of player with 64 brown_terracotta named "&7Brown Stained Clay" with lore "&c$1000" to run function buyItem(player, 1000, 159:12)
  96. format gui slot 28 of player with 64 green_terracotta named "&7Green Stained Clay" with lore "&c$1000" to run function buyItem(player, 1000, 159:13)
  97. format gui slot 29 of player with 64 red_terracotta named "&7Red Stained Clay" with lore "&c$1000" to run function buyItem(player, 1000, 159:14)
  98. format gui slot 30 of player with 64 black_terracotta named "&7Black Stained Clay" with lore "&c$1000" to run function buyItem(player, 1000, 159:15)
  99. format gui slot 45 of player with 1 barrier named "&cClick to go Back" to run player command "/shop blocksw"
  100. format gui slot 53 of player with 1 arrow named "&cClick to go to Woods" to run player command "/shop blockswood"
  101. if arg-1 is "blockswood":
  102. open virtual chest inventory with size 6 named "&2&lBlocks (Woods)" to player
  103. wait 2 tick
  104. set {_slot} to 0
  105. loop 54 times:
  106. format gui slot {_slot} of player with gray glass named "&7"
  107. add 1 to {_slot}
  108. format gui slot 10 of player with 64 oak_log named "&7Oak Log" with lore "&c$400" to run function buyItem(player, 400, 17)
  109. format gui slot 11 of player with 64 spruce_log named "&7Spruce Log" with lore "&c$400" to run function buyItem(player, 400, 17:1)
  110. format gui slot 12 of player with 64 birch_log named "&7Birch Log" with lore "&c$400" to run function buyItem(player, 400, 17:2)
  111. format gui slot 13 of player with 64 jungle_log named "&7Jungle Log" with lore "&c$4000" to run function buyItem(player, 4000, 17:3)
  112. format gui slot 45 of player with 1 barrier named "&cClick to go Back" to run player command "/shop blocksc"
  113. if arg-1 is "redstone":
  114. open virtual chest inventory with size 6 named "&c&lRedstone" to player
  115. wait 2 tick
  116. set {_slot} to 0
  117. loop 54 times:
  118. format gui slot {_slot} of player with gray glass named "&7"
  119. add 1 to {_slot}
  120. format gui slot 10 of player with 64 dispenser named "&7Dispenser" with lore "&c$2000" to run function buyItem(player, 2000, 23)
  121. format gui slot 11 of player with 64 note_block named "&7Noteblock" with lore "&c$1050" to run function buyItem(player, 1050, 25)
  122. format gui slot 12 of player with 1 jukebox named "&7Juke Box" with lore "&c$180" to run function buyItem(player, 180, 84)
  123. format gui slot 13 of player with 64 piston_base named "&7Piston" with lore "&c$1600" to run function buyItem(player, 1600, 33)
  124. format gui slot 14 of player with 64 sticky_piston_base named "&7Sticky Piston" with lore "&c$3100" to run function buyItem(player, 400, 29)
  125. format gui slot 15 of player with 64 redstone_lamp named "&7Redstone Lamp" with lore "&c$1800" to run function buyItem(player, 1800, 123)
  126. format gui slot 16 of player with 64 inactive_golden_pressure_plate named "&7Weighted Pressure Plate (Light)" with lore "&c$1600" to run function buyItem(player, 1600, 147)
  127. format gui slot 19 of player with 64 inactive_iron_pressure_plate named "&7Weighted Pressure Plate (Heavy)" with lore "&c$4000" to run function buyItem(player, 4000, 148)
  128. format gui slot 20 of player with 64 redstone_block named "&7Redstone Block" with lore "&c$2200" to run function buyItem(player, 2200, 152)
  129. format gui slot 21 of player with 64 hopper named "&7Hopper" with lore "&c$5000" to run function buyItem(player, 5000, 154)
  130. format gui slot 22 of player with 64 dropper named "&7Dropper" with lore "&c$2000" to run function buyItem(player, 2000, 158)
  131. format gui slot 23 of player with 64 redstone_repeater_item named "&7Redstone Repeater" with lore "&c$1200" to run function buyItem(player, 1200, 356)
  132. format gui slot 24 of player with 64 redstone_comparator_item named "&7Redstone Comparator" with lore "&c$1700" to run function buyItem(player, 1700, 404)
  133. format gui slot 25 of player with 64 daylight_sensor named "&7Daylight Sensor" with lore "&c$2100" to run function buyItem(player, 2200, 151)
  134. format gui slot 45 of player with 1 barrier named "&cClick to go Back" to run player command "/shopt"
  135.  
  136. on inventory click:
  137. if inventory name of player's current inventory is "&cShop" or "&2&lBlocks (Basics)" or "&2&lBlocks (Wools)" or "&2&lBlocks (Clays)" or "&2&lBlocks (Woods)" or "&c&lRedstone":
  138. cancel event
  139.  
  140.  
  141. function buyItem(p: player, cost: integer, i: item type):
  142. if {_p}'s balance >= {_cost}:
  143. remove {_cost} from {_p}'s balance
  144. give 64 of {_i} to {_p}
  145. else:
  146. send "&cYou cannot afford this item!" to {_p}
Advertisement
Add Comment
Please, Sign In to add comment