on inventory click issue.

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

KAVKAZIE

Active Member
Feb 27, 2017
146
0
16
This is the code:
Code:
on inventory click:
    if inventory name of player's current inventory is "&8Animals Hats (1/2)":
        if clicked slot is 53:
            cancel event
            close player's inventory

And if the item on slot 53 named the click event doesnt work.
It's doesnt work for GUIs and if the item named but on normal chest its works.
 
Last edited:
Hey, How to do "Next Page" in GUI ?
Q6ZSg3J.png
Something like that:
code_language.skript:
command /animalskull [<text>]:
    trigger:
        arg 1 isn't set:
            open chest with 6 rows named "Animals Skulls 1" to player
            set slot #... code here
            set slot 50 of player's current inventory to arrow named "&bNext Page >"
        arg 1 is "2":
            wait 3 ticks
            open chest with 6 rows named "Animals Skulls 2" to player
            #here you make the code with animal' skulls
            set slot#... code here
           
on inventory click:
    clicked inventory is not player's inventory
    if inventory name of player's current inventory is "Animal skulls 1":
        clicked slot = #slots here#:
            #the code that should go here.
            #and:
        clicked slot = 50: #50 is slot number of the arrow
            close player's inventory
            wait 3 ticks
            execute player command "animalskull 2
Something like this I did on my server.
 
This is the code:
Code:
on inventory click:
    if inventory name of player's current inventory is "&8Animals Hats (1/2)":
        if clicked slot is 53:
            cancel event
            close player's inventory

And if the item on slot 53 named the click event doesnt work.
 
This is the code:
Code:
on inventory click:
    if inventory name of player's current inventory is "&8Animals Hats (1/2)":
        if clicked slot is 53:
            cancel event
            close player's inventory

And if the item on slot 53 named the click event doesnt work.
Why you use "cancel event"?

If you have a useless slot, make code:
code_language.skript:
event-slot = black stained glass pane:
    close player's inventory # Or whatever you want.
 
Why you use "cancel event"?
doesnt work with out it anyways.
[doublepost=1553822355,1553821073][/doublepost]
Why you use "cancel event"?

If you have a useless slot, make code:
code_language.skript:
event-slot = black stained glass pane:
    close player's inventory # Or whatever you want.
Code:
set slot 53 of player's current inventory to barrier named "&cClose"
this the clicked slot.
[doublepost=1553822470][/doublepost]
Why you use "cancel event"?

If you have a useless slot, make code:
code_language.skript:
event-slot = black stained glass pane:
    close player's inventory # Or whatever you want.
can you send me how to do
Code:
event-slot = black stained glass pane:
    close player's inventory # Or whatever you want.
?
 
doesnt work with out it anyways.
[doublepost=1553822355,1553821073][/doublepost]
Code:
set slot 53 of player's current inventory to barrier named "&cClose"
this the clicked slot.
[doublepost=1553822470][/doublepost]
can you send me how to do
Code:
event-slot = black stained glass pane:
    close player's inventory # Or whatever you want.
?
code_language.skript:
on inventory click:
    clicked inventory isn't player's inventory
    inventory name of player's current inventory is "(Name of inv)":
        event-slot = barrier:
            close player's inventory
[doublepost=1553824135][/doublepost]
doesnt work with out it anyways.
[doublepost=1553822355,1553821073][/doublepost]
Code:
set slot 53 of player's current inventory to barrier named "&cClose"
this the clicked slot.
[doublepost=1553822470][/doublepost]
can you send me how to do
Code:
event-slot = black stained glass pane:
    close player's inventory # Or whatever you want.
?
What I have on my server, is that if you click the event-slot that is useless (In this case the barrier) closes the player's inventory and you wait for 3 ticks, and then make the command execute the command that opens the GUI
 
code_language.skript:
on inventory click:
    clicked inventory isn't player's inventory
    inventory name of player's current inventory is "(Name of inv)":
        event-slot = barrier:
            close player's inventory
[doublepost=1553824135][/doublepost]
What I have on my server, is that if you click the event-slot that is useless (In this case the barrier) closes the player's inventory and you wait for 3 ticks, and then make the command execute the command that opens the GUI
I need it by slots :emoji_frowning:
[doublepost=1553825212,1553825115][/doublepost]
code_language.skript:
on inventory click:
    clicked inventory isn't player's inventory
    inventory name of player's current inventory is "(Name of inv)":
        event-slot = barrier:
            close player's inventory
[doublepost=1553824135][/doublepost]
What I have on my server, is that if you click the event-slot that is useless (In this case the barrier) closes the player's inventory and you wait for 3 ticks, and then make the command execute the command that opens the GUI
the clicked slots works when there is no name on the item.
 
I need it by slots :emoji_frowning:
[doublepost=1553825212,1553825115][/doublepost]
the clicked slots works when there is no name on the item.
-

Better not complicate, and do not put any item in areas where they do not need it.
[doublepost=1553828762][/doublepost]
I need it by slots
if is for slots, use:
code_language.skript:
on inventory click:
    clicked inventory isn't player's inventory   
    inventory name of player's current inventory is "(Name of inv)":
        set {_n} to 0
        loop 10 times: # For the 1st line of GUI
            add 1 to {_n}
            clicked slot = {_n}:
                close player's inventory
#I think that's the way it is.#
 
It's says on code:
Code:
on inventory click:
    clicked inventory isn't player's inventory
    inventory name of player's current inventory is "(Name of inv)":
        event-slot = barrier:
            close player's inventory
this:
kppQXIO.png
 
It's says on code:
Code:
on inventory click:
    clicked inventory isn't player's inventory
    inventory name of player's current inventory is "(Name of inv)":
        event-slot = barrier:
            close player's inventory
this:
kppQXIO.png
event-item = arrow:
try that.
 
Status
Not open for further replies.