Advertisement
Guest User

Untitled

a guest
Mar 30th, 2020
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.31 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 6 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) of {_inv} 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 named "&3Pumpkin Seeds" with lore "&fCosts:", "&f1x $4k", "&f16x $64k", "&f64x $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 named "&eMelon Seeds" with lore "&fCosts:", "&f1x $2k", "&f16x $32k", "&f64x $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 named "&9Beetroot seeds" with lore "&fCosts:", "&f1x $500", "&f16x $8k", "&f64x $32k", "", "&7((Left click = 1x))", "&7((Right click = 16x))" and "&7((Middle click = 64x))"
  58. set slot 13 of {_inv} to 16 of sugar cane named "&aSugar Cane" with lore "&fCosts:", "&f1x $8k", "&f16x $128k", "&f64x $512k", "", "&7((Left click = 1x))", "&7((Right click = 16x))" and "&7((Middle click = 64x))"
  59. set slot 14 of {_inv} to 16 of cactus named "&2Cactus" with lore "&fCosts:", "&f1x $8k", "&f16x $128k", "&f64x $512k", "", "&7((Left click = 1x))", "&7((Right click = 16x))" and "&7((Middle click = 64x))"
  60. set slot 15 of {_inv} to 8 of pumpkin named "&6Pumpkin" with lore "&fCosts:", "&f1x $12k", "&f16x $192k", "&f64x $768k", "", "&7((Left click = 1x))", "&7((Right click = 16x))" and "&7((Middle click = 64x))"
  61. set slot 16 of {_inv} to 8 of melon slice named "&9Melon Slice" with lore "&fCosts:", "&f1x $6k", "&f16x $96k", "&f64x $384k", "", "&7((Left click = 1x))", "&7((Right click = 16x))" and "&7((Middle click = 64x))"
  62. set slot 19 of {_inv} to 16 of nether wart named "&cNether Wart" with lore "&fCosts:", "&f1x $1.3k", "&f16x $20.8k", "&f64x $83.2k", "", "&7((Left click = 1x))", "&7((Right click = 16x))" and "&7((Middle click = 64x))"
  63. set slot 20 of {_inv} to 4 of soul sand named "&4Soul Sand" with lore "&fCosts:", "&f1x $700", "&f16x $11.2k", "&f64x $44.8k", "", "&7((Left click = 1x))", "&7((Right click = 16x))" and "&7((Middle click = 64x))"
  64. open {_inv} to player
  65. else if event-slot = redstone block:
  66. send "Redstone Shop"
  67.  
  68. function buySeeds(p: player, name: text, price: integer):
  69. if {_p}'s balance >= {_price}:
  70. remove {_price} from {_p}'s balance
  71. give {_p} 1 of wheat seeds named "&b&l%{_name}% Plant" with lore "", "&7Place to use" and ""
  72.  
  73. function buyFarming(p: player, item: string, price: integer, x: integer, s: integer):
  74. if {_p}'s balance >= {_price}*{_x}:
  75. remove {_price}*{_x} from {_p}'s balance
  76. give {_p} {_x}*{_s} of {_item}
  77.  
  78. function getItem(p: player, item: string, price: integer, s: integer, c: click type):
  79. buyFarming({_p}, {_item}, {_price}, 1, {_s}) if "%{_c}%" = "left mouse button"
  80. buyFarming({_p}, {_item}, {_price}, 16, {_s}) if "%{_c}%" = "right mouse button"
  81. buyFarming({_p}, {_item}, {_price}, 64, {_s}) if "%{_c}%" = "middle mouse button"
  82.  
  83. on inventory click:
  84. if event-inventory != player's inventory:
  85. if event-slot = red glass pane:
  86. if name of event-slot = "&4Main Menu":
  87. mainShop(player)
  88. else if inventory name of current inventory of player = "&c&lCustom Seeds":
  89. cancel event
  90. if event-slot = wheat seeds:
  91. if name of event-slot = "&b&lWheat Plant":
  92. buySeeds(player, "Wheat", 250)
  93. else if name of event-slot = "&b&lCoal Plant":
  94. buySeeds(player, "Coal", 1000)
  95. else if name of event-slot = "&b&lIron Plant":
  96. buySeeds(player, "Iron", 3000)
  97. else if name of event-slot = "&b&lGold Plant":
  98. buySeeds(player, "Gold", 5000)
  99. else if name of event-slot = "&b&lDiamond Plant":
  100. buySeeds(player, "Diamond", 15000)
  101. else if name of event-slot = "&b&lEmerald Plant":
  102. buySeeds(player, "Emerald", 30000)
  103. else if inventory name of current inventory of player = "&a&lFarming":
  104. cancel event
  105. if event-slot = beetroot seeds:
  106. getItem(player, beetroot seeds, 500, 4, click type)
  107. else if event-slot = melon seeds:
  108. getItem(player, melon seeds, 2000, 4, click type)
  109. else if event-slot = pumpkin seeds:
  110. getItem(player, pumpkin seeds, 4000, 4, click type)
  111. else if event-slot = sugar cane:
  112. getItem(player, sugar cane, 8000, 16, click type)
  113. else if event-slot = cactus:
  114. getItem(player, cactus, 8000, 16, click type)
  115. else if event-slot = pumpkin:
  116. getItem(player, cactus, 8000, 8, click type)
  117. else if event-slot = nether wart:
  118. getItem(player, nether wart, 1300, 16, click type)
  119. else if event-slot = soul sand:
  120. getItem(player, soul sand, 700, 4, click type)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement