Jump to content

Item Click in GUI opens new GUI or gives player items?


Spink

Recommended Posts

Need help with my Script. I made a GUI Script to open up a menu and display navigation to other pages, but i am not sure how to make it open a new GUI or give a player an item on click.

 

The Script:

command /shop:
    trigger:
        open virtual chest inventory with size 3 named "&8&lShop" to player
        format slot 0 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 1 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 2 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 3 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 4 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 5 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 6 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 7 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 8 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 9 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 10 of player with Iron Block named "&f&lGenerators" to be unstealable
        format slot 11 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 12 of player with Oak Plank named "&e&lBlocks" to be unstealable
        format slot 13 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 14 of player with Water Bucket named "&b&lEssentials" to be unstealable
        format slot 15 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 16 of player with Blaze Rod named "&6&lWands " to be unstealable
        format slot 17 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 18 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 19 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 20 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 21 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 22 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 23 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 24 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 25 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 26 of player with Gray Stained Glass Pane named "&f&l " to be unstealable

 

Link to comment
Share on other sites

This post has been moved to the Skript category.

Edited by Swirs

Discord - swirs#0069

In-game name - swiirs

---------------------------------------------------------

[VIP] - July 1st 2020

Support - 9/6/20 | 11/3/20

Helper  - 11/3/20 - 1/10/2021

Moderator - 1/10/2021 - 5/17/2021

Retired - 5/17/2021 - Present

Joined Minehut Mid-late 2015

---------------------------------------------------------

Link to comment
Share on other sites

 

On 11/14/2020 at 2:19 PM, Spink said:

Need help with my Script. I made a GUI Script to open up a menu and display navigation to other pages, but i am not sure how to make it open a new GUI or give a player an item on click.

 

The Script:



command /shop:
    trigger:
        open virtual chest inventory with size 3 named "&8&lShop" to player
        format slot 0 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 1 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 2 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 3 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 4 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 5 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 6 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 7 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 8 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 9 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 10 of player with Iron Block named "&f&lGenerators" to be unstealable
        format slot 11 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 12 of player with Oak Plank named "&e&lBlocks" to be unstealable
        format slot 13 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 14 of player with Water Bucket named "&b&lEssentials" to be unstealable
        format slot 15 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 16 of player with Blaze Rod named "&6&lWands " to be unstealable
        format slot 17 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 18 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 19 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 20 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 21 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 22 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 23 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 24 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 25 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 26 of player with Gray Stained Glass Pane named "&f&l " to be unstealable

 

            

format slot <line> of player with <item> named "<name>" to run "<command, can be sudo cmd with essentials>"

 

Edited by AgentGamerPro

 

 

image.png.bc433d6489d70ad831075fe76809b993.png
 

Lifestealed | Minecraft Servers
 

OG [VIP] 12/26/20 - 10/27/2021
OG [PRO] 12/27/21 - 11/18/2022
OG [LEGEND] 11/18/2022 - 3/14/2023
[DEFAULT] 3/14/2023 - Present

 

Link to comment
Share on other sites

You could do this

on inventory click:
  if inventory name of player's current inventory is "Example":
    if clicked slot is 1:
      send "this is where you run the code eg. open another chest inventory etc."
      close player's inventory
      open virtual chest inventory with size 3 named "Example 2" to player

Thats just an example ^^ but you get the idea.

Youtube: https://www.youtube.com/c/83y123

Discord: 83y#2552

IGN: 83y

 

If your seeing this I am currently banned from Posting, the Discord and GitHub

I have helped out countless player's and been re-payed with multiple bans.

staff are attention seeking and biased, i'd just leave for your sake.

your just wasting your time.

like.gif

Link to comment
Share on other sites

Hello I never recommend using SkQuery as a GUI but I will give you a SkQuery AND TuSKe answer

 

command /shop:
    trigger:
        open virtual chest inventory with size 3 named "&8&lShop" to player
        format slot 0 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 1 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 2 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 3 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 4 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 5 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 6 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 7 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 8 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 9 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 10 of player with Iron Block named "&f&lGenerators" to close then run [execute player command /shop1]
        format slot 11 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 12 of player with Oak Plank named "&e&lBlocks" to close then run [execute player command /shop2]
        format slot 13 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 14 of player with Water Bucket named "&b&lEssentials" to close then run [execute player command /shop3]
        format slot 15 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 16 of player with Blaze Rod named "&6&lWands " to close then run [execute player command /shop4]
        format slot 17 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 18 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 19 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 20 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 21 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 22 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 23 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 24 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 25 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
        format slot 26 of player with Gray Stained Glass Pane named "&f&l " to be unstealable
command /shop1:
    trigger:
        open virtual chest inventory with size 3 named "&8&lGenerators" to player
        #event here
command /shop:
    trigger:
        open virtual chest inventory with size 3 named "&8&lShop" to player
        format gui slot 0 of player with gray stained glass pane named "&f&l "  
        format gui slot 1 of player with gray stained glass pane named "&f&l "  
        format gui slot 2 of player with gray stained glass pane named "&f&l "  
        format gui slot 3 of player with gray stained glass pane named "&f&l "  
        format gui slot 4 of player with gray stained glass pane named "&f&l "  
        format gui slot 5 of player with gray stained glass pane named "&f&l "  
        format gui slot 6 of player with gray stained glass pane named "&f&l "  
        format gui slot 7 of player with gray stained glass pane named "&f&l "  
        format gui slot 8 of player with gray stained glass pane named "&f&l "  
        format gui slot 9 of player with gray stained glass pane named "&f&l "  
        format gui slot 10 of player with iron block named "&f&lGenerators"to run:
            open virtual chest inventory with size 3 named "&f&lGenerators" to player
            #event here
        format gui slot 11 of player with gray stained glass pane named "&f&l "  
        format gui slot 12 of player with oak Plank named "&e&lBlocks"to run:
            open virtual chest inventory with size 3 named "&e&lBlocks" to player
            #event here
        format gui slot 13 of player with gray stained glass pane named "&f&l "  
        format gui slot 14 of player with Water Bucket named "&b&lEssentials"to run:
            open virtual chest inventory with size 3 named "&b&lEssentials" to player
            #event here
        format gui slot 15 of player with gray stained glass pane named "&f&l "  
        format gui slot 16 of player with Blaze Rod named "&6&lWands "to run:
            open virtual chest inventory with size 3 named "&6&lWands" to player
            #event here
        format gui slot 17 of player with gray stained glass pane named "&f&l "  
        format gui slot 18 of player with gray stained glass pane named "&f&l "  
        format gui slot 19 of player with gray stained glass pane named "&f&l "  
        format gui slot 20 of player with gray stained glass pane named "&f&l "  
        format gui slot 21 of player with gray stained glass pane named "&f&l "  
        format gui slot 22 of player with gray stained glass pane named "&f&l "  
        format gui slot 23 of player with gray stained glass pane named "&f&l "  
        format gui slot 24 of player with gray stained glass pane named "&f&l "  
        format gui slot 25 of player with gray stained glass pane named "&f&l "  
        format gui slot 26 of player with gray stained glass pane named "&f&l "  

 

Link to comment
Share on other sites

  • 2 years later...

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...