function shop(plr: player, p: number, amt: number, i: item):
set {_x} to {_plr}'s uuid
if {balance::%{_x}%} > {_p}:
remove {_p} from {balance::%{_x}%}
give {_plr} of {_amt} of {_i}
play sound "entity.experience_orb.pickup" to {_plr}
send "&cPurchase complete" to {_plr}
else:
send "&cInsufficient funds." to {_plr}
command /shop [<text>]:
trigger:
if arg-1 is not set:
open virtual chest inventory named "Shop" to player
format slot (all integers between 0 and 26) of player with gray stained glass pane named " " to do nothing
format slot 11 of player with gray grass block named "Blocks shop" to make player run command [/shop block]
if arg-1 is "blocks":
open virtual chest inventory named "Block shop" to player
format slot (all integers between 0 and 26) of player with gray stained glass pane named " " to do nothing
format slot 11 of player with grass block named "Buy 16 grass blocks" with lore "Cost: 50$" to run function shop(player, 50, 16, grass block)
that uses skelett, skyrayfall, skript and i think query but should give you an a general idea of what you should do, it's not complete but you can add new items yourself.
(also couldn't test it so uh yeah)