Uploaded by Meatball

log

advertisement
#!Made by meatball
function Buy(item: item type, price: num, p: player):
set {_v::*} to vanilla name of {_item}
replace all "minecraft:" and "_block" with "" in {_v::1}
replace all "_" with " " in {_v::1}
set {_puuid} to the uuid of {_p}
if {balance::%{_puuid}%} is greater than or equal to {_price}:
remove {_price} from {balance::%{_puuid}%}
give {_p} 1 of {_item}
send "&e&l(!) &eYou successfully bought &71x &6&n%{_v::1}%&e for &6&n$%{_price}%&e." to {_p}
else:
send "&e&l(!) &eYou don't have enough money, you need &6&n$%{_price}%&e to buy this item." to {_p}
command /shop:
trigger:
set metadata tag "shop" of player to chest with 5 rows named "<bold><aqua>Angel<white><bold>Gens <yellow>Shop"
set slot 13 of metadata tag "shop" of player to grass block named "&2Blocks"
set slot 21 of metadata tag "shop" of player to diamond pickaxe named "<blue>Tools"
set slot 22 of metadata tag "shop" of player to oak log named "&6Generators"
set slot 23 of metadata tag "shop" of player to redstone block named "<light red>Automation"
set slot 31 of metadata tag "shop" of player to chest named "<yellow>Misc."
loop 46 times:
if {_count} is 13, 21, 22, 23, or 31:
add 1 to {_count}
else:
set slot {_count} of metadata tag "shop" of player to gray stained glass pane named "&7"
add 1 to {_count}
open (metadata tag "shop" of player) to player 
Download