Advertisement
Guest User

Untitled

a guest
Mar 30th, 2020
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.57 KB | None | 0 0
  1. function mainShop(p: player):
  2. set {_inv} to chest inventory with 3 rows named "&5&lShop"
  3. set slot (integers from 0 to 8) of {_inv} to gray glass pane
  4. set slot 9 and 17 of {_inv} to gray glass pane
  5. set slot (integers from 18 to 26) of {_inv} to gray glass pane
  6. set slot 10 of {_inv} to grass block named "&a&lBlocks"
  7. set slot 11 of {_inv} to redstone block named "&4&lRedstone"
  8. set slot 12 of {_inv} to heart of the sea named "&b&lMisc"
  9. set slot 14 of {_inv} to wheat seeds named "&c&lCustom Seeds"
  10. set slot 15 of {_inv} to sugar cane named "&a&lFarming"
  11. set slot 16 of {_inv} to nametag named "&e&lPerks"
  12. open {_inv} to {_p}
  13.  
  14. command /shop:
  15. trigger:
  16. mainShop(player)
  17.  
  18. on inventory click:
  19. if event-inventory != player's inventory:
  20. if inventory name of current inventory of player = "&5&lShop":
  21. cancel event
  22. if event-slot = grass block:
  23. send "Block Shop"
  24. else if event-slot = heart of the sea:
  25. send "Misc Shop"
  26. else if event-slot = wheat seeds:
  27. set {_inv} to chest inventory with 3 rows named "&c&lCustom Seeds"
  28. set slot (integers from 0 to 8) of {_inv} to gray glass pane
  29. set slot 9 and 17 of {_inv} to gray glass pane
  30. set slot (integers from 18 to 26) of {_inv} to gray glass pane
  31. set slot 18 of {_inv} to red glass pane named "&4Main Menu"
  32. set slot 10 of {_inv} to wheat seeds named "&b&lWheat Plant" with lore "", "&7Place to use" and ""
  33. set slot 11 of {_inv} to wheat seeds named "&b&lCoal Plant" with lore "", "&7Place to use" and ""
  34. set slot 12 of {_inv} to wheat seeds named "&b&lIron Plant" with lore "", "&7Place to use" and ""
  35. set slot 13 of {_inv} to wheat seeds named "&b&lGold Plant" with lore "", "&7Place to use" and ""
  36. set slot 14 of {_inv} to wheat seeds named "&b&lDiamond Plant" with lore "", "&7Place to use" and ""
  37. set slot 15 of {_inv} to wheat seeds named "&b&lEmerald Plant" with lore "", "&7Place to use" and ""
  38. set slot 16 of {_inv} to barrier
  39. open {_inv} to player
  40. else if event-slot = nametag:
  41. set {_inv} to chest inventory with 3 rows named "&c&lCustom Seeds"
  42. set slot (integers from 0 to 8) of {_inv} to gray glass pane
  43. set slot 9 and 17 of {_inv} to gray glass pane
  44. set slot (integers from 18 to 26) of {_inv} to gray glass pane
  45. set slot 18 of {_inv} to red glass pane named "&4Main Menu"
  46. set slot 10 of {_inv} to cooked beef named "&c&lFeed" with lore "&7/feed for 15 minutes", "" and "&7Costs: $20k"
  47. set slot 11 of {_inv} to grass block named "&a&l+3 Plots" with lore "&73 Extra Plots", "" and "&7Costs: $2m"
  48. open {_inv} to player
  49. else if event-slot = sugar cane:
  50. set {_inv} to chest inventory with 3 rows named "&a&lFarming"
  51. set slot (integers from 0 to 8) of {_inv} to gray glass pane
  52. set slot 9,17,18,26,27,35,36 and 44 of {_inv} to gray glass pane
  53. set slot (integers from 46 to 53) to gray glass pane
  54. set slot 45 of {_inv} to red glass pane named "&4Main Menu"
  55. set slot 12 of {_inv} to 4 of pumpkin seeds with lore "Costs:", "1x $4k", "16x $64k", "64x $256k", "", "&7((Left click = 1x))", "&7((Right click = 16x))" and "&7((Middle click = 64x))"
  56. set slot 11 of {_inv} to 4 of melon seeds with lore "Costs:", "1x $2k", "16x $32k", "64x $128k", "", "&7((Left click = 1x))", "&7((Right click = 16x))" and "&7((Middle click = 64x))"
  57. set slot 10 of {_inv} to 4 of beetroot seeds with lore "Costs:", "1x $500", "16x $8k", "64x $32k", "", "&7((Left click = 1x))", "&7((Right click = 16x))" and "&7((Middle click = 64x))"
  58. open {_inv} to player
  59. else if event-slot = redstone block:
  60. send "Redstone Shop"
  61.  
  62. function buySeeds(p: player, name: text, price: integer):
  63. if {_p}'s balance >= {_price}:
  64. remove {_price} from {_p}'s balance
  65. give {_p} 1 of wheat seeds named "&b&l%{_name}% Plant" with lore "", "&7Place to use" and ""
  66.  
  67. on inventory click:
  68. if event-inventory != player's inventory:
  69. if inventory name of current inventory of player = "&c&lCustom Seeds":
  70. cancel event
  71. if event-slot = red glass pane:
  72. mainShop(player)
  73. if event-slot = wheat seeds:
  74. if name of event-slot = "&b&lWheat Plant":
  75. buySeeds(player, "Wheat", 250)
  76. else if name of event-slot = "&b&lCoal Plant":
  77. buySeeds(player, "Coal", 1000)
  78. else if name of event-slot = "&b&lIron Plant":
  79. buySeeds(player, "Iron", 3000)
  80. else if name of event-slot = "&b&lGold Plant":
  81. buySeeds(player, "Gold", 5000)
  82. else if name of event-slot = "&b&lDiamond Plant":
  83. buySeeds(player, "Diamond", 15000)
  84. else if name of event-slot = "&b&lEmerald Plant":
  85. buySeeds(player, "Emerald", 30000)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement