Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function addShopItem(p: player, shop: text, item: text, sell: number, buy: number):
- add {_item} to {shopitems::%{_shop}%::*}
- set {shopbuyprice::%{_shop}%::%{_item}%} to {_buy}
- set {shopsellprice::%{_shop}%::%{_item}%} to {_sell}
- function removeShopItem(p: player, shop: text, item: text):
- remove {_item} from {shopitems::%{_shop}%::*}
- delete {shopbuyprice::%{_shop}%::%{_item}%}
- delete {shopsellprice::%{_shop}%::%{_item}%}
- command /addshopitem [<text>] [<text>] [<number>] [<number>]:
- permission: add.shop.item
- trigger:
- if arg 1 is set:
- if arg 2 is set:
- if arg 3 is set:
- if arg 4 is set:
- addShopItem(player, arg 1, arg 2, arg 3, arg 4)
- send "Add %arg 2% to shop %arg 1% with sell %arg 3% and buy %arg 4%" to player
- command /removeshopitem [<text>] [<text>]:
- permission: add.shop.item
- trigger:
- if arg 1 is set:
- if arg 2 is set:
- removeShopItem(player, arg 1, arg 2)
- send "remove %arg 2% from shop %arg 1%" to player
- command /shopdeleteall:
- trigger:
- loop {shopitems::Potions::*}:
- delete {shopbuyprice::Potions::%loop-value%}
- delete {shopsellprice::Potions::%loop-value%}
- remove loop-value from {shopitems::Potions::*}
- command /shop:
- trigger:
- shopGUI(player)
- function shopGUI(p: player):
- open virtual chest inventory named " &nRoaming Shop" to {_p}
- format a gui slot 10 of {_p} with grass block named "&a&lBlocks Shop &7(%size of {shopitems::Blocks::*}% blocks)" to close then run function shopPage({_p}, 0, "Blocks")
- format a gui slot 11 of {_p} with bone named "&a&lMiscellaneous Shop &7(%size of {shopitems::Misc::*}% items)" to close then run function shopPage({_p}, 0, "Misc")
- format a gui slot 12 of {_p} with poppy named "&a&lDecoration Shop &7(%size of {shopitems::Decoration::*}% items)" to close then run function shopPage({_p}, 0, "Decoration")
- format a gui slot 13 of {_p} with brewing stand named "&a&lPotion Shop &7(%size of {shopitems::Potions::*}% potions)" to close then run function shopPage({_p}, 0, "Potions")
- format a gui slot 14 of {_p} with hoe named "&a&lFarming Shop &7(%size of {shopitems::Farming::*}% items)" to close then run function shopPage({_p}, 0, "Farming")
- format a gui slot 15 of {_p} with steak named "&a&lFood Shop &7(%size of {shopitems::Food::*}% foods)" to close then run function shopPage({_p}, 0, "Food")
- format a gui slot 16 of {_p} with redstone named "&a&lRedstone Shop &7(%size of {shopitems::Redstone::*}% items)" to close then run function shopPage({_p}, 0, "Redstone")
- function shopBuy(p: player, shop: text, item: text):
- open virtual chest inventory with size 6 named "Buy %{_item}%" to {_p}
- set {_buy} to {shopbuyprice::%{_shop}%::%{_item}%}
- set {_sell} to {shopsellprice::%{_shop}%::%{_item}%}
- set {blockvalue::%{_p}%} to 1
- set {_blocks} to {blockvalue::%{_p}%}
- set {blockvalue::%{_p}%} to {_blocks}
- set {_itemtype} to {_item} parsed as item
- format a gui slot 22 of {_p} with {_itemtype} named "&f%{_item}% &7x%{_blocks}%" with lore "&7Buy for &a&l$%{_blocks}*{shopbuyprice::%{_shop}%::%{_item}%}%" to do nothing
- format a gui slot 31 of {_p} with sunflower named "&e&lConfirm Purchase" with lore "&7Click to confirm your purchase" to run:
- set {_ha} to {blockvalue::%{_p}%}*{shopbuyprice::%{_shop}%::%{_item}%}
- set {_itemtype} to {_item} parsed as item
- if {_p}'s balance is greater than or equal to {_ha}:
- close {_p}'s inventory
- remove {blockvalue::%{_p}%}*{shopbuyprice::%{_shop}%::%{_item}%} from {_p}'s balance
- send title "&e&lPURCHASE SUCCESSFULL" with subtitle "&fYou purchased &7%{blockvalue::%{_p}%}% %{_item}% &ffor &7$%{blockvalue::%{_p}%}*{shopbuyprice::%{_shop}%::%{_item}%}%" to {_p} for 4 seconds
- give {blockvalue::%{_p}%} of {_itemtype} to {_p}
- else if {_p}'s balance is less than {_ha}:
- send "&cNot enough money in your balance" to {_p}
- format a gui slot 24 of {_p} with minecart with chest named "&a&lAdd 512 %{_item}%" with lore "&7Click to buy 512 %{_item}%" to run:
- set {_blocks} to {blockvalue::%{_p}%}
- if {_blocks} is greater than 0:
- add 512 to {_blocks}
- set slot 22 of {_p}'s current inventory to {_itemtype} named "&f%{_item}% &7x%{_blocks}%" with lore "&7Buy for &a&l$%{_blocks}*{shopbuyprice::%{_shop}%::%{_item}%}%"
- set {blockvalue::%{_p}%} to {_blocks}
- format a gui slot 20 of {_p} with minecart named "&c&lReset %{_item}% Value" with lore "&7Click to reset %{_item}% value" to run:
- set {blockvalue::%{_p}%} to 1
- set {_blocks} to {blockvalue::%{_p}%}
- set slot 22 of {_p}'s current inventory to {_itemtype} named "&f%{_item}% &7x%{_blocks}%" with lore "&7Buy for &a&l$%{_blocks}*{shopbuyprice::%{_shop}%::%{_item}%}%"
- format a gui slot 0 of {_p} with green stained glass pane named "&a&l+ 1 %{_item}%" to run:
- set {_blocks} to {blockvalue::%{_p}%}
- if {_blocks} is greater than 0:
- add 1 to {_blocks}
- set slot 22 of {_p}'s current inventory to {_itemtype} named "&f%{_item}% &7x%{_blocks}%" with lore "&7Buy for &a&l$%{_blocks}*{shopbuyprice::%{_shop}%::%{_item}%}%"
- set {blockvalue::%{_p}%} to {_blocks}
- format a gui slot 1 of {_p} with green stained glass pane named "&a&l+ 2 %{_item}%" to run:
- set {_blocks} to {blockvalue::%{_p}%}
- if {_blocks} is greater than 0:
- add 2 to {_blocks}
- set slot 22 of {_p}'s current inventory to {_itemtype} named "&f%{_item}% &7x%{_blocks}%" with lore "&7Buy for &a&l$%{_blocks}*{shopbuyprice::%{_shop}%::%{_item}%}%"
- set {blockvalue::%{_p}%} to {_blocks}
- format a gui slot 2 of {_p} with green stained glass pane named "&a&l+ 4 %{_item}%" to run:
- set {_blocks} to {blockvalue::%{_p}%}
- if {_blocks} is greater than 0:
- add 4 to {_blocks}
- set slot 22 of {_p}'s current inventory to {_itemtype} named "&f%{_item}% &7x%{_blocks}%" with lore "&7Buy for &a&l$%{_blocks}*{shopbuyprice::%{_shop}%::%{_item}%}%"
- set {blockvalue::%{_p}%} to {_blocks}
- format a gui slot 3 of {_p} with green stained glass pane named "&a&l+ 8 %{_item}%" to run:
- set {_blocks} to {blockvalue::%{_p}%}
- if {_blocks} is greater than 0:
- add 8 to {_blocks}
- set slot 22 of {_p}'s current inventory to {_itemtype} named "&f%{_item}% &7x%{_blocks}%" with lore "&7Buy for &a&l$%{_blocks}*{shopbuyprice::%{_shop}%::%{_item}%}%"
- set {blockvalue::%{_p}%} to {_blocks}
- format a gui slot 4 of {_p} with green stained glass pane named "&a&l+ 16 %{_item}%" to run:
- set {_blocks} to {blockvalue::%{_p}%}
- if {_blocks} is greater than 0:
- add 16 to {_blocks}
- set slot 22 of {_p}'s current inventory to {_itemtype} named "&f%{_item}% &7x%{_blocks}%" with lore "&7Buy for &a&l$%{_blocks}*{shopbuyprice::%{_shop}%::%{_item}%}%"
- set {blockvalue::%{_p}%} to {_blocks}
- format a gui slot 5 of {_p} with green stained glass pane named "&a&l+ 32 %{_item}%" to run:
- set {_blocks} to {blockvalue::%{_p}%}
- if {_blocks} is greater than 0:
- add 32 to {_blocks}
- set slot 22 of {_p}'s current inventory to {_itemtype} named "&f%{_item}% &7x%{_blocks}%" with lore "&7Buy for &a&l$%{_blocks}*{shopbuyprice::%{_shop}%::%{_item}%}%"
- set {blockvalue::%{_p}%} to {_blocks}
- format a gui slot 6 of {_p} with green stained glass pane named "&a&l+ 64 %{_item}%" to run:
- set {_blocks} to {blockvalue::%{_p}%}
- if {_blocks} is greater than 0:
- add 64 to {_blocks}
- set slot 22 of {_p}'s current inventory to {_itemtype} named "&f%{_item}% &7x%{_blocks}%" with lore "&7Buy for &a&l$%{_blocks}*{shopbuyprice::%{_shop}%::%{_item}%}%"
- set {blockvalue::%{_p}%} to {_blocks}
- format a gui slot 7 of {_p} with green stained glass pane named "&a&l+ 128 %{_item}%" to run:
- set {_blocks} to {blockvalue::%{_p}%}
- if {_blocks} is greater than 0:
- add 128 to {_blocks}
- set slot 22 of {_p}'s current inventory to {_itemtype} named "&f%{_item}% &7x%{_blocks}%" with lore "&7Buy for &a&l$%{_blocks}*{shopbuyprice::%{_shop}%::%{_item}%}%"
- set {blockvalue::%{_p}%} to {_blocks}
- format a gui slot 8 of {_p} with green stained glass pane named "&a&l+ 256 %{_item}%" to run:
- set {_blocks} to {blockvalue::%{_p}%}
- if {_blocks} is greater than 0:
- add 256 to {_blocks}
- set slot 22 of {_p}'s current inventory to {_itemtype} named "&f%{_item}% &7x%{_blocks}%" with lore "&7Buy for &a&l$%{_blocks}*{shopbuyprice::%{_shop}%::%{_item}%}%"
- set {blockvalue::%{_p}%} to {_blocks}
- format a gui slot 45 of {_p} with red stained glass pane named "&c&l- 1 %{_item}%" to run:
- set {_blocks} to {blockvalue::%{_p}%}
- if {_blocks} is less than 1:
- send "&cYou cannot go into a negative figure" to {_p}
- else if {_blocks} is greater than 1:
- if {_blocks} is greater than or equal to 64:
- remove 1 from {_blocks}
- else if {_blocks} is less than 64:
- remove 1 from {_blocks}
- set slot 22 of {_p}'s current inventory to {_itemtype} named "&f%{_item}% &7x%{_blocks}%" with lore "&7Buy for &a&l$%{_blocks}*{shopbuyprice::%{_shop}%::%{_item}%}%"
- set {blockvalue::%{_p}%} to {_blocks}
- format a gui slot 46 of {_p} with red stained glass pane named "&c&l- 2 %{_item}%" to run:
- set {_blocks} to {blockvalue::%{_p}%}
- if {_blocks} is less than 2:
- send "&cYou cannot go into a negative figure" to {_p}
- else if {_blocks} is greater than 2:
- if {_blocks} is greater than or equal to 64:
- remove 2 from {_blocks}
- else if {_blocks} is less than 64:
- remove 2 from {_blocks}
- set slot 22 of {_p}'s current inventory to {_itemtype} named "&f%{_item}% &7x%{_blocks}%" with lore "&7Buy for &a&l$%{_blocks}*{shopbuyprice::%{_shop}%::%{_item}%}%"
- set {blockvalue::%{_p}%} to {_blocks}
- format a gui slot 47 of {_p} with red stained glass pane named "&c&l- 4 %{_item}%" to run:
- set {_blocks} to {blockvalue::%{_p}%}
- if {_blocks} is less than 4:
- send "&cYou cannot go into a negative figure" to {_p}
- else if {_blocks} is greater than 4:
- if {_blocks} is greater than or equal to 64:
- remove 4 from {_blocks}
- else if {_blocks} is less than 64:
- remove 4 from {_blocks}
- set slot 22 of {_p}'s current inventory to {_itemtype} named "&f%{_item}% &7x%{_blocks}%" with lore "&7Buy for &a&l$%{_blocks}*{shopbuyprice::%{_shop}%::%{_item}%}%"
- set {blockvalue::%{_p}%} to {_blocks}
- format a gui slot 48 of {_p} with red stained glass pane named "&c&l- 8 %{_item}%" to run:
- set {_blocks} to {blockvalue::%{_p}%}
- if {_blocks} is less than 8:
- send "&cYou cannot go into a negative figure" to {_p}
- else if {_blocks} is greater than 8:
- if {_blocks} is greater than or equal to 64:
- remove 8 from {_blocks}
- else if {_blocks} is less than 64:
- remove 8 from {_blocks}
- set slot 22 of {_p}'s current inventory to {_itemtype} named "&f%{_item}% &7x%{_blocks}%" with lore "&7Buy for &a&l$%{_blocks}*{shopbuyprice::%{_shop}%::%{_item}%}%"
- set {blockvalue::%{_p}%} to {_blocks}
- format a gui slot 49 of {_p} with red stained glass pane named "&c&l- 16 %{_item}%" to run:
- set {_blocks} to {blockvalue::%{_p}%}
- if {_blocks} is less than 16:
- send "&cYou cannot go into a negative figure" to {_p}
- else if {_blocks} is greater than 16:
- if {_blocks} is greater than or equal to 64:
- remove 16 from {_blocks}
- set slot 22 of {_p}'s current inventory to 64 of {_itemtype} named "&f%{_item}% &7x%{_blocks}%" with lore "&7Buy for &a&l$%{_blocks}*{shopbuyprice::%{_shop}%::%{_item}%}%"
- else if {_blocks} is less than 64:
- remove 16 from {_blocks}
- set slot 22 of {_p}'s current inventory to {_itemtype} named "&f%{_item}% &7x%{_blocks}%" with lore "&7Buy for &a&l$%{_blocks}*{shopbuyprice::%{_shop}%::%{_item}%}%"
- set {blockvalue::%{_p}%} to {_blocks}
- format a gui slot 50 of {_p} with red stained glass pane named "&c&l- 32 %{_item}%" to run:
- set {_blocks} to {blockvalue::%{_p}%}
- if {_blocks} is greater than 32:
- if {_blocks} is greater than or equal to 64:
- remove 32 from {_blocks}
- else if {_blocks} is less than 64:
- remove 32 from {_blocks}
- set slot 22 of {_p}'s current inventory to {_itemtype} named "&f%{_item}% &7x%{_blocks}%" with lore "&7Buy for &a&l$%{_blocks}*{shopbuyprice::%{_shop}%::%{_item}%}%"
- else if {_blocks} is less than 32:
- send "&cYou cannot go into a negative figure" to {_p}
- set {blockvalue::%{_p}%} to {_blocks}
- format a gui slot 51 of {_p} with red stained glass pane named "&c&l- 64 %{_item}%" to run:
- set {_blocks} to {blockvalue::%{_p}%}
- if {_blocks} is less than 64:
- send "&cYou cannot go into a negative figure" to {_p}
- else if {_blocks} is greater than 64:
- remove 64 from {_blocks}
- else if {_blocks} is less than 64:
- remove 64 from {_blocks}
- set slot 22 of {_p}'s current inventory to {_itemtype} named "&f%{_item}% &7x%{_blocks}%" with lore "&7Buy for &a&l$%{_blocks}*{shopbuyprice::%{_shop}%::%{_item}%}%"
- set {blockvalue::%{_p}%} to {_blocks}
- format a gui slot 52 of {_p} with red stained glass pane named "&c&l- 128 %{_item}%" to run:
- set {_blocks} to {blockvalue::%{_p}%}
- if {_blocks} is less than 128:
- send "&cYou cannot go into a negative figure" to {_p}
- else if {_blocks} is greater than 128:
- remove 128 from {_blocks}
- else if {_blocks} is less than 64:
- remove 128 from {_blocks}
- set slot 22 of {_p}'s current inventory to {_itemtype} named "&f%{_item}% &7x%{_blocks}%" with lore "&7Buy for &a&l$%{_blocks}*{shopbuyprice::%{_shop}%::%{_item}%}%"
- set {blockvalue::%{_p}%} to {_blocks}
- format a gui slot 53 of {_p} with red stained glass pane named "&c&l- 256 %{_item}%" to run:
- set {_blocks} to {blockvalue::%{_p}%}
- if {_blocks} is less than 256:
- send "&cYou cannot go into a negative figure" to {_p}
- else if {_blocks} is greater than 256:
- remove 256 from {_blocks}
- send "%{_blocks}%" to {_p}
- else if {_blocks} is less than 256:
- remove 256 from {_blocks}
- send "%{_blocks}%" to {_p}
- set slot 22 of {_p}'s current inventory to {_itemtype} named "&f%{_item}% &7x%{_blocks}%" with lore "&7Buy for &a&l$%{_blocks}*{shopbuyprice::%{_shop}%::%{_item}%}%"
- set {blockvalue::%{_p}%} to {_blocks}
- function shopSell(p: player, shop: text, item: text):
- open virtual chest inventory with size 6 named "Sell %{_item}%" to {_p}
- set {_sell} to {shopsellprice::%{_shop}%::%{_item}%}
- set {_sell} to {shopsellprice::%{_shop}%::%{_item}%}
- set {blockvalue::%{_p}%} to 1
- set {_blocks} to {blockvalue::%{_p}%}
- set {blockvalue::%{_p}%} to {_blocks}
- set {_itemtype} to {_item} parsed as item
- format a gui slot 22 of {_p} with {_itemtype} named "&f%{_item}% &7x%{_blocks}%" with lore "&7Sell for &a&l$%{_blocks}*{shopsellprice::%{_shop}%::%{_item}%}%" to do nothing
- format a gui slot 31 of {_p} with sunflower named "&e&lConfirm Sell" with lore "&7Click to confirm your sell" to run:
- set {_ha} to {blockvalue::%{_p}%}*{shopsellprice::%{_shop}%::%{_item}%}
- set {_itemtype} to {_item} parsed as item
- if {_p} has {blockvalue::%{_p}%} of {_itemtype}:
- close {_p}'s inventory
- add {blockvalue::%{_p}%}*{shopsellprice::%{_shop}%::%{_item}%} to {_p}'s balance
- send title "&e&lSELL SUCCESSFULL" with subtitle "&fYou sold &7%{blockvalue::%{_p}%}% %{_item}% &ffor &7$%{blockvalue::%{_p}%}*{shopsellprice::%{_shop}%::%{_item}%}%" to {_p} for 4 seconds
- remove {blockvalue::%{_p}%} of {_itemtype} from {_p}
- else if {_p} does not have {blockvalue::%{_p}%} of {_itemtype}:
- send "&cNot enough %{_item}%&c in your inventory" to {_p}
- format a gui slot 24 of {_p} with minecart with chest named "&a&lSet to Inventory Amount" with lore "&7Click to set to inventory amount value" to run:
- set {_amount} to amount of {_itemtype} in {_p}'s inventory
- if {_amount} is not 0:
- set {_blocks} to {blockvalue::%{_p}%}
- if {_blocks} is greater than 0:
- set {_blocks} to {_amount}
- set slot 22 of {_p}'s current inventory to {_itemtype} named "&f%{_item}% &7x%{_blocks}%" with lore "&7Sell for &a&l$%{_blocks}*{shopsellprice::%{_shop}%::%{_item}%}%"
- else if {_amount} is 0:
- send "&cNot enough %{_item}%&c in your inventory" to {_p}
- set {blockvalue::%{_p}%} to {_blocks}
- format a gui slot 20 of {_p} with minecart named "&c&lReset %{_item}% Value" with lore "&7Click to reset %{_item}% value" to run:
- set {blockvalue::%{_p}%} to 1
- set {_blocks} to {blockvalue::%{_p}%}
- set slot 22 of {_p}'s current inventory to {_itemtype} named "&f%{_item}% &7x%{_blocks}%" with lore "&7Sell for &a&l$%{_blocks}*{shopsellprice::%{_shop}%::%{_item}%}%"
- format a gui slot 0 of {_p} with green stained glass pane named "&a&l+ 1 %{_item}%" to run:
- set {_blocks} to {blockvalue::%{_p}%}
- if {_blocks} is greater than 0:
- add 1 to {_blocks}
- set slot 22 of {_p}'s current inventory to {_itemtype} named "&f%{_item}% &7x%{_blocks}%" with lore "&7Sell for &a&l$%{_blocks}*{shopsellprice::%{_shop}%::%{_item}%}%"
- set {blockvalue::%{_p}%} to {_blocks}
- format a gui slot 1 of {_p} with green stained glass pane named "&a&l+ 2 %{_item}%" to run:
- set {_blocks} to {blockvalue::%{_p}%}
- if {_blocks} is greater than 0:
- add 2 to {_blocks}
- set slot 22 of {_p}'s current inventory to {_itemtype} named "&f%{_item}% &7x%{_blocks}%" with lore "&7Sell for &a&l$%{_blocks}*{shopsellprice::%{_shop}%::%{_item}%}%"
- set {blockvalue::%{_p}%} to {_blocks}
- format a gui slot 2 of {_p} with green stained glass pane named "&a&l+ 4 %{_item}%" to run:
- set {_blocks} to {blockvalue::%{_p}%}
- if {_blocks} is greater than 0:
- add 4 to {_blocks}
- set slot 22 of {_p}'s current inventory to {_itemtype} named "&f%{_item}% &7x%{_blocks}%" with lore "&7Sell for &a&l$%{_blocks}*{shopsellprice::%{_shop}%::%{_item}%}%"
- set {blockvalue::%{_p}%} to {_blocks}
- format a gui slot 3 of {_p} with green stained glass pane named "&a&l+ 8 %{_item}%" to run:
- set {_blocks} to {blockvalue::%{_p}%}
- if {_blocks} is greater than 0:
- add 8 to {_blocks}
- set slot 22 of {_p}'s current inventory to {_itemtype} named "&f%{_item}% &7x%{_blocks}%" with lore "&7Sell for &a&l$%{_blocks}*{shopsellprice::%{_shop}%::%{_item}%}%"
- set {blockvalue::%{_p}%} to {_blocks}
- format a gui slot 4 of {_p} with green stained glass pane named "&a&l+ 16 %{_item}%" to run:
- set {_blocks} to {blockvalue::%{_p}%}
- if {_blocks} is greater than 0:
- add 16 to {_blocks}
- set slot 22 of {_p}'s current inventory to {_itemtype} named "&f%{_item}% &7x%{_blocks}%" with lore "&7Sell for &a&l$%{_blocks}*{shopsellprice::%{_shop}%::%{_item}%}%"
- set {blockvalue::%{_p}%} to {_blocks}
- format a gui slot 5 of {_p} with green stained glass pane named "&a&l+ 32 %{_item}%" to run:
- set {_blocks} to {blockvalue::%{_p}%}
- if {_blocks} is greater than 0:
- add 32 to {_blocks}
- set slot 22 of {_p}'s current inventory to {_itemtype} named "&f%{_item}% &7x%{_blocks}%" with lore "&7Sell for &a&l$%{_blocks}*{shopsellprice::%{_shop}%::%{_item}%}%"
- set {blockvalue::%{_p}%} to {_blocks}
- format a gui slot 6 of {_p} with green stained glass pane named "&a&l+ 64 %{_item}%" to run:
- set {_blocks} to {blockvalue::%{_p}%}
- if {_blocks} is greater than 0:
- add 64 to {_blocks}
- set slot 22 of {_p}'s current inventory to {_itemtype} named "&f%{_item}% &7x%{_blocks}%" with lore "&7Sell for &a&l$%{_blocks}*{shopsellprice::%{_shop}%::%{_item}%}%"
- set {blockvalue::%{_p}%} to {_blocks}
- format a gui slot 7 of {_p} with green stained glass pane named "&a&l+ 128 %{_item}%" to run:
- set {_blocks} to {blockvalue::%{_p}%}
- if {_blocks} is greater than 0:
- add 128 to {_blocks}
- set slot 22 of {_p}'s current inventory to {_itemtype} named "&f%{_item}% &7x%{_blocks}%" with lore "&7Sell for &a&l$%{_blocks}*{shopsellprice::%{_shop}%::%{_item}%}%"
- set {blockvalue::%{_p}%} to {_blocks}
- format a gui slot 8 of {_p} with green stained glass pane named "&a&l+ 256 %{_item}%" to run:
- set {_blocks} to {blockvalue::%{_p}%}
- if {_blocks} is greater than 0:
- add 256 to {_blocks}
- set slot 22 of {_p}'s current inventory to {_itemtype} named "&f%{_item}% &7x%{_blocks}%" with lore "&7Sell for &a&l$%{_blocks}*{shopsellprice::%{_shop}%::%{_item}%}%"
- set {blockvalue::%{_p}%} to {_blocks}
- format a gui slot 45 of {_p} with red stained glass pane named "&c&l- 1 %{_item}%" to run:
- set {_blocks} to {blockvalue::%{_p}%}
- if {_blocks} is less than 1:
- send "&cYou cannot go into a negative figure" to {_p}
- else if {_blocks} is greater than 1:
- if {_blocks} is greater than or equal to 64:
- remove 1 from {_blocks}
- else if {_blocks} is less than 64:
- remove 1 from {_blocks}
- set slot 22 of {_p}'s current inventory to {_itemtype} named "&f%{_item}% &7x%{_blocks}%" with lore "&7Sell for &a&l$%{_blocks}*{shopsellprice::%{_shop}%::%{_item}%}%"
- set {blockvalue::%{_p}%} to {_blocks}
- format a gui slot 46 of {_p} with red stained glass pane named "&c&l- 2 %{_item}%" to run:
- set {_blocks} to {blockvalue::%{_p}%}
- if {_blocks} is less than 2:
- send "&cYou cannot go into a negative figure" to {_p}
- else if {_blocks} is greater than 2:
- if {_blocks} is greater than or equal to 64:
- remove 2 from {_blocks}
- else if {_blocks} is less than 64:
- remove 2 from {_blocks}
- set slot 22 of {_p}'s current inventory to {_itemtype} named "&f%{_item}% &7x%{_blocks}%" with lore "&7Sell for &a&l$%{_blocks}*{shopsellprice::%{_shop}%::%{_item}%}%"
- set {blockvalue::%{_p}%} to {_blocks}
- format a gui slot 47 of {_p} with red stained glass pane named "&c&l- 4 %{_item}%" to run:
- set {_blocks} to {blockvalue::%{_p}%}
- if {_blocks} is less than 4:
- send "&cYou cannot go into a negative figure" to {_p}
- else if {_blocks} is greater than 4:
- if {_blocks} is greater than or equal to 64:
- remove 4 from {_blocks}
- else if {_blocks} is less than 64:
- remove 4 from {_blocks}
- set slot 22 of {_p}'s current inventory to {_itemtype} named "&f%{_item}% &7x%{_blocks}%" with lore "&7Sell for &a&l$%{_blocks}*{shopsellprice::%{_shop}%::%{_item}%}%"
- set {blockvalue::%{_p}%} to {_blocks}
- format a gui slot 48 of {_p} with red stained glass pane named "&c&l- 8 %{_item}%" to run:
- set {_blocks} to {blockvalue::%{_p}%}
- if {_blocks} is less than 8:
- send "&cYou cannot go into a negative figure" to {_p}
- else if {_blocks} is greater than 8:
- if {_blocks} is greater than or equal to 64:
- remove 8 from {_blocks}
- else if {_blocks} is less than 64:
- remove 8 from {_blocks}
- set slot 22 of {_p}'s current inventory to {_itemtype} named "&f%{_item}% &7x%{_blocks}%" with lore "&7Sell for &a&l$%{_blocks}*{shopsellprice::%{_shop}%::%{_item}%}%"
- set {blockvalue::%{_p}%} to {_blocks}
- format a gui slot 49 of {_p} with red stained glass pane named "&c&l- 16 %{_item}%" to run:
- set {_blocks} to {blockvalue::%{_p}%}
- if {_blocks} is less than 16:
- send "&cYou cannot go into a negative figure" to {_p}
- else if {_blocks} is greater than 16:
- if {_blocks} is greater than or equal to 64:
- remove 16 from {_blocks}
- set slot 22 of {_p}'s current inventory to 64 of {_itemtype} named "&f%{_item}% &7x%{_blocks}%" with lore "&7Sell for &a&l$%{_blocks}*{shopsellprice::%{_shop}%::%{_item}%}%"
- else if {_blocks} is less than 64:
- remove 16 from {_blocks}
- set slot 22 of {_p}'s current inventory to {_itemtype} named "&f%{_item}% &7x%{_blocks}%" with lore "&7Sell for &a&l$%{_blocks}*{shopsellprice::%{_shop}%::%{_item}%}%"
- set {blockvalue::%{_p}%} to {_blocks}
- format a gui slot 50 of {_p} with red stained glass pane named "&c&l- 32 %{_item}%" to run:
- set {_blocks} to {blockvalue::%{_p}%}
- if {_blocks} is greater than 32:
- if {_blocks} is greater than or equal to 64:
- remove 32 from {_blocks}
- else if {_blocks} is less than 64:
- remove 32 from {_blocks}
- set slot 22 of {_p}'s current inventory to {_itemtype} named "&f%{_item}% &7x%{_blocks}%" with lore "&7Sell for &a&l$%{_blocks}*{shopsellprice::%{_shop}%::%{_item}%}%"
- else if {_blocks} is less than 32:
- send "&cYou cannot go into a negative figure" to {_p}
- set {blockvalue::%{_p}%} to {_blocks}
- format a gui slot 51 of {_p} with red stained glass pane named "&c&l- 64 %{_item}%" to run:
- set {_blocks} to {blockvalue::%{_p}%}
- if {_blocks} is less than 64:
- send "&cYou cannot go into a negative figure" to {_p}
- else if {_blocks} is greater than 64:
- remove 64 from {_blocks}
- else if {_blocks} is less than 64:
- remove 64 from {_blocks}
- set slot 22 of {_p}'s current inventory to {_itemtype} named "&f%{_item}% &7x%{_blocks}%" with lore "&7Sell for &a&l$%{_blocks}*{shopsellprice::%{_shop}%::%{_item}%}%"
- set {blockvalue::%{_p}%} to {_blocks}
- format a gui slot 52 of {_p} with red stained glass pane named "&c&l- 128 %{_item}%" to run:
- set {_blocks} to {blockvalue::%{_p}%}
- if {_blocks} is less than 128:
- send "&cYou cannot go into a negative figure" to {_p}
- else if {_blocks} is greater than 128:
- remove 128 from {_blocks}
- else if {_blocks} is less than 64:
- remove 128 from {_blocks}
- set slot 22 of {_p}'s current inventory to {_itemtype} named "&f%{_item}% &7x%{_blocks}%" with lore "&7Sell for &a&l$%{_blocks}*{shopsellprice::%{_shop}%::%{_item}%}%"
- set {blockvalue::%{_p}%} to {_blocks}
- format a gui slot 53 of {_p} with red stained glass pane named "&c&l- 256 %{_item}%" to run:
- set {_blocks} to {blockvalue::%{_p}%}
- if {_blocks} is less than 256:
- send "&cYou cannot go into a negative figure" to {_p}
- else if {_blocks} is greater than 256:
- remove 256 from {_blocks}
- send "%{_blocks}%" to {_p}
- else if {_blocks} is less than 256:
- remove 256 from {_blocks}
- send "%{_blocks}%" to {_p}
- set slot 22 of {_p}'s current inventory to {_itemtype} named "&f%{_item}% &7x%{_blocks}%" with lore "&7Sell for &a&l$%{_blocks}*{shopsellprice::%{_shop}%::%{_item}%}%"
- set {blockvalue::%{_p}%} to {_blocks}
- function shopPage(p: player, page: number, shop: text):
- set {_pageStart} to 45*{_page}
- set {_i} to 1
- set {_a} to 0
- open virtual chest inventory with size 6 named "%{_shop}% Shop | Page: %{_page} + 1%" to {_p}
- format a gui slot 45 and 47 and 48 and 50 and 51 and 52 and 53 and 46 of {_p} with black stained glass pane named "" to do nothing
- wait 2 ticks
- loop {shopitems::%{_shop}%::*}:
- (loop-index parsed as integer) > {_pageStart}
- set {_item} to "%loop-value%" parsed as item
- format a gui slot {_a} of {_p} with {_item} named "&f%loop-value% &7x1" with lore "" and "&7Buy for &a&l$%{shopbuyprice::%{_shop}%::%loop-value%}%" and "&7Sell for &c&l$%{shopsellprice::%{_shop}%::%loop-value%}%" and "" and "&aLeft-Click to &a&lBUY" and "&cRight-Click to &c&lSELL" and "" to run function shopBuy({_p}, {_shop}, loop-value) with "left" click
- format a gui slot {_a} of {_p} with {_item} named "&f%loop-value% &7x1" with lore "" and "&7Buy for &a&l$%{shopbuyprice::%{_shop}%::%loop-value%}%" and "&7Sell for &c&l$%{shopsellprice::%{_shop}%::%loop-value%}%" and "" and "&aLeft-Click to &a&lBUY" and "&cRight-Click to &c&lSELL" and "" to run function shopSell({_p}, {_shop}, loop-value) with "right" click
- add 1 to {_a}
- if {_a} = ((45*{_i})):
- exit loop
- format a gui slot 49 of {_p} with gray dye named "&cGo back" to run function shopGUI({_p})
- if (amount of {shopitems::%{_shop}%::*}) > {_pageStart} + 45:
- format a gui slot 53 of {_p} with arrow named "&eNext Page" to run function shopPage({_p}, {_page} + 1, {_shop})
- if {_page} > 0:
- format a gui slot 45 of {_p} with arrow named "&ePrevious Page" to run function shopPage({_p}, ({_page} - 1), {_shop})
- on block form of cobblestone:
- chance of 1%:
- set event-block to diamond ore
- stop
- chance of 5%:
- set event-block to gold ore
- stop
- chance of 10%:
- set event-block to iron ore
- stop
- chance of 15%:
- set event-block to coal ore
- stop
Advertisement
Add Comment
Please, Sign In to add comment