Hi everyone! So I've been trying to make a GUI shop for my gens server and I have a small problem. I don't really know how to add commands to when you click on something you want to buy, then it should take the money away and give you the thing. If anyone could help me out, I would really appreciate it!
Here's what I've done as of right now:
command /shop:
trigger:
open chest inventory with 3 rows named "&aShop" to player
format gui slot 16 of player with barrier named "&cComing soon"
format gui slot 10 of player with block of coal named "&7Gens" with lore "&6You can buy gens here!" to close:
open chest inventory with 1 rows named "&7Gens" to player
format gui slot 0 of player with block of coal with lore "&a&l$175" to run:
format gui slot 1 of player with block of iron with lore "&a&l$4,500"
format gui slot 2 of player with block of gold with lore "&a&l$35,000"
format gui slot 3 of player with lapis lazuli block with lore "&a&l$95,000"
format gui slot 4 of player with block of redstone with lore "&a&l$185,000"
format gui slot 5 of player with block of diamond with lore "&a&l$390,000"
format gui slot 6 of player with block of emerald with lore "&a&l$780,000"
format gui slot 7 of player with block of netherite with lore "&a&l$1,750,000"
format gui slot 8 of player with arrow named "&cClose" to close