Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- command /shop [<text>]:
- trigger:
- open virtual chest inventory with size 6 named "&cShop" to player
- wait 2 tick
- set {_slot} to 0
- loop 54 times:
- format gui slot {_slot} of player with gray glass named "&7"
- add 1 to {_slot}
- format gui slot 10 of player with grass named "&2&lBlocks" to run player command "/shop blocks"
- format gui slot 12 of player with redstone named "&c&lRedstone" to run player command "/shop redstone"
- format gui slot 14 of player with seeds named "&a&LCrops" to run player command "/shop crops"
- format gui slot 16 of player with water bucket named "&3&lMiscellaneous" to run player command "/shop mis"
- format gui slot 20 of player with diamond named "&b&lMinerals" to run player command "/shop minerals"
- format gui slot 22 of player with mob_spawner named "&8&lSpawners" to run player command "/shop spawners"
- format gui slot 24 of player with dispenser named "&7&lMachines" to run player command "/shop machines"
- format gui slot 40 of player with blaze rod named "&6&LSell Wands" to run player command "/shop wands"
- if arg-1 is "blocks":
- open virtual chest inventory with size 6 named "&2&lBlocks (Basics)" to player
- wait 2 tick
- set {_slot} to 0
- loop 54 times:
- format gui slot {_slot} of player with gray glass named "&7"
- add 1 to {_slot}
- format gui slot 10 of player with 64 grass named "&7Grass" with lore "&c$150" to run function buyItem(player, 150, grass)
- format gui slot 11 of player with 64 dirt named "&7Dirt" with lore "&c$100" to run function buyItem(player, 100, dirt)
- format gui slot 12 of player with 64 stone named "&7Stone" with lore "&c$150" to run function buyItem(player, 150, 1:0)
- format gui slot 13 of player with 64 cobble_stone named "&7Cobblestone" with lore "&c$100" to run function buyItem(player, 100, 4)
- 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)
- 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)
- format gui slot 16 of player with 64 gravel named "&7Gravel" with lore "&c$150" to run function buyItem(player, 150, gravel)
- format gui slot 19 of player with 64 sand named "&7Sand" with lore "&c$150" to run function buyItem(player, 150, sand)
- format gui slot 20 of player with 64 sand stone named "&7Sandstone" with lore "&c$200" to run function buyItem(player, 200, sandstone)
- 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)
- 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)
- format gui slot 23 of player with 64 redsand named "&7Red Sand" with lore "&c$250" to run function buyItem(player, 250, 12:1)
- format gui slot 24 of player with 64 red sandstone named "&7Red Sandstone" with lore "&c$400" to run function buyItem(player, 400, 179)
- 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)
- 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)
- format gui slot 29 of player with 64 snow named "&7Snow" with lore "&c$200" to run function buyItem(player, 200, 80)
- format gui slot 30 of player with 64 ice named "&7Ice" with lore "&c$150" to run function buyItem(player, 150, ice)
- format gui slot 31 of player with 64 packed ice named "&7Packed Ice" with lore "&c$6000" to run function buyItem(player, 6000, 174)
- format gui slot 32 of player with 64 ender_stone named "&7Endstone" with lore "&c$500" to run function buyItem(player, 500, 121)
- format gui slot 33 of player with 64 obsidian named "&7Obsidian" with lore "&c$350" to run function buyItem(player, 350, obsidian)
- format gui slot 34 of player with 64 netherrack named "&7Netherrack" with lore "&c$50" to run function buyItem(player, 50, netherrack)
- format gui slot 37 of player with 64 soul sand named "&7Soul Sand" with lore "&c$150" to run function buyItem(player, 150, 88)
- format gui slot 38 of player with 64 quartz_block named "&7Quartz Block" with lore "&c$200" to run function buyItem(player, 200, 155)
- 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)
- format gui slot 45 of player with 1 barrier named "&cClick to go Back" to run player command "/shop"
- format gui slot 53 of player with 1 arrow named "&cClick to go to Wools" to run player command "/shop blocksw"
- if arg-1 is "blocksw":
- open virtual chest inventory with size 6 named "&2&lBlocks (Wools)" to player
- wait 2 tick
- set {_slot} to 0
- loop 54 times:
- format gui slot {_slot} of player with gray glass named "&7"
- add 1 to {_slot}
- 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)
- 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)
- 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)
- 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)
- 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)
- 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)
- 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)
- 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)
- 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)
- 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)
- 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)
- 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)
- 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)
- 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)
- 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)
- 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)
- format gui slot 45 of player with 1 barrier named "&cClick to go Back" to run player command "/shop blocks"
- format gui slot 53 of player with 1 arrow named "&cClick to go to Clays" to run player command "/shop blocksc"
- if arg-1 is "blocksc":
- open virtual chest inventory with size 6 named "&2&lBlocks (Clays)" to player
- wait 2 tick
- set {_slot} to 0
- loop 54 times:
- format gui slot {_slot} of player with gray glass named "&7"
- add 1 to {_slot}
- format gui slot 10 of player with 64 clay_block named "&7Clay" with lore "&c$600" to run function buyItem(player, 600, 82)
- 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)
- 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)
- 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)
- 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)
- 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)
- 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)
- 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)
- 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)
- 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)
- 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)
- 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)
- 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)
- 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)
- 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)
- 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)
- 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)
- format gui slot 45 of player with 1 barrier named "&cClick to go Back" to run player command "/shop blocksw"
- format gui slot 53 of player with 1 arrow named "&cClick to go to Woods" to run player command "/shop blockswood"
- if arg-1 is "blockswood":
- open virtual chest inventory with size 6 named "&2&lBlocks (Woods)" to player
- wait 2 tick
- set {_slot} to 0
- loop 54 times:
- format gui slot {_slot} of player with gray glass named "&7"
- add 1 to {_slot}
- format gui slot 10 of player with 64 oak_log named "&7Oak Log" with lore "&c$400" to run function buyItem(player, 400, 17)
- 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)
- 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)
- 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)
- format gui slot 45 of player with 1 barrier named "&cClick to go Back" to run player command "/shop blocksc"
- if arg-1 is "redstone":
- open virtual chest inventory with size 6 named "&c&lRedstone" to player
- wait 2 tick
- set {_slot} to 0
- loop 54 times:
- format gui slot {_slot} of player with gray glass named "&7"
- add 1 to {_slot}
- format gui slot 10 of player with 64 dispenser named "&7Dispenser" with lore "&c$2000" to run function buyItem(player, 2000, 23)
- format gui slot 11 of player with 64 note_block named "&7Noteblock" with lore "&c$1050" to run function buyItem(player, 1050, 25)
- format gui slot 12 of player with 1 jukebox named "&7Juke Box" with lore "&c$180" to run function buyItem(player, 180, 84)
- format gui slot 13 of player with 64 piston_base named "&7Piston" with lore "&c$1600" to run function buyItem(player, 1600, 33)
- 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)
- format gui slot 15 of player with 64 redstone_lamp named "&7Redstone Lamp" with lore "&c$1800" to run function buyItem(player, 1800, 123)
- 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)
- 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)
- format gui slot 20 of player with 64 redstone_block named "&7Redstone Block" with lore "&c$2200" to run function buyItem(player, 2200, 152)
- format gui slot 21 of player with 64 hopper named "&7Hopper" with lore "&c$5000" to run function buyItem(player, 5000, 154)
- format gui slot 22 of player with 64 dropper named "&7Dropper" with lore "&c$2000" to run function buyItem(player, 2000, 158)
- 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)
- 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)
- format gui slot 25 of player with 64 daylight_sensor named "&7Daylight Sensor" with lore "&c$2100" to run function buyItem(player, 2200, 151)
- format gui slot 45 of player with 1 barrier named "&cClick to go Back" to run player command "/shopt"
- on inventory click:
- 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":
- cancel event
- function buyItem(p: player, cost: integer, i: item type):
- if {_p}'s balance >= {_cost}:
- remove {_cost} from {_p}'s balance
- give 64 of {_i} to {_p}
- else:
- send "&cYou cannot afford this item!" to {_p}
Advertisement
Add Comment
Please, Sign In to add comment