Jump to content

Skript GUI help needed!


RichMuffin13

Recommended Posts

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
 

Link to comment
Share on other sites

Add "to run:" at the end of a format to run something on click, if you are using Essantial's economy (And not custom currency) you need Essantials (ofc) and vault.

Example:

format gui slot 0 of player with block of coal with lore "&a&l$175" to run:
	if player's balance >= 175:
    	remove 175 from player's balance
    	give player a block of coal

Note: vanilla guis are better.

Discord: Juffix#4773

Minecraft UsernameJuffix

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...