command /shop:
trigger:
open virtual chest inventory with size 5 named "Shop" to player
format gui slot 0, 1, 2, 3, 4, 5, 6, 7, 8, 36, 37, 38, 39, 41, 42, 43, and 44 of player with black stained glass pane named " "
format gui slot 40 of player with red stained glass pane named "&cExit" to run:
close player's inventory
format gui slot 19 of player with iron chestplate named "&7Armor" to run:
close player's inventory
open virtual chest inventory with size 5 named "Shop" to player
format gui slot 0, 1, 2, 3, 4, 5, 6, 7, 8, 36, 37, 38, 39, 41, 42, 43, and 44 of player with black stained glass pane named " "
format gui slot 40 of player with red stained glass pane named "&cBack" to run:
close player's inventory
make player execute "/shop"
format gui slot 9 of player with leather helmet named "&7Leather Helmet" with lore "&7Price: 500" to run:
buy(leather tunic, 1, 500, player)
function buy(i: item, a: integer, price: number, p: player):
set {_uuid} to {_p}'s uuid
give {_p} {_a} of {_i}
remove {_price} from {Rblocks::%player's uuid%}
else:
close {_p}'s inventory
send "&cYou don’t have enough to buy this, silly!"
Don't mind the indents
trigger:
open virtual chest inventory with size 5 named "Shop" to player
format gui slot 0, 1, 2, 3, 4, 5, 6, 7, 8, 36, 37, 38, 39, 41, 42, 43, and 44 of player with black stained glass pane named " "
format gui slot 40 of player with red stained glass pane named "&cExit" to run:
close player's inventory
format gui slot 19 of player with iron chestplate named "&7Armor" to run:
close player's inventory
open virtual chest inventory with size 5 named "Shop" to player
format gui slot 0, 1, 2, 3, 4, 5, 6, 7, 8, 36, 37, 38, 39, 41, 42, 43, and 44 of player with black stained glass pane named " "
format gui slot 40 of player with red stained glass pane named "&cBack" to run:
close player's inventory
make player execute "/shop"
format gui slot 9 of player with leather helmet named "&7Leather Helmet" with lore "&7Price: 500" to run:
buy(leather tunic, 1, 500, player)
function buy(i: item, a: integer, price: number, p: player):
set {_uuid} to {_p}'s uuid
give {_p} {_a} of {_i}
remove {_price} from {Rblocks::%player's uuid%}
else:
close {_p}'s inventory
send "&cYou don’t have enough to buy this, silly!"
Don't mind the indents