on click GUI

  • 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 community!

    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!

DanRub

Active Member
Jun 3, 2023
214
22
18
Hi, I need some advice on a script to send a command after clicking on a certain slot in the GUI
For example, i have on server gui VIP, i need that when player click on gold ingot to close him invetnory and send to chat message.
Something like:
on inventory click:
if name of player's current inventory is "&e&lVIP":
if clicked slot is 11: #for me it's the golden ingot
send "<message>"

if someone know, please help me :emoji_grinning:
 

Attachments

  • upload_2023-6-3_21-27-31.png
    upload_2023-6-3_21-27-31.png
    326 bytes · Views: 204
Is this what you want?
Code:
command /gui:
  trigger:
    open virtual chest inventory with size 1 named "test" to player
    format gui slot 4 with golden ingot named "whatever you want" with lore "sends a random message" to run:
      send "this is a random message" to player
      close player's inventory
Maybe im wrong I didn't test it yet.
[doublepost=1685885204,1685885132][/doublepost]btw for this you need tuske I think
 
Is this what you want?
Code:
command /gui:
  trigger:
    open virtual chest inventory with size 1 named "test" to player
    format gui slot 4 with golden ingot named "whatever you want" with lore "sends a random message" to run:
      send "this is a random message" to player
      close player's inventory
Maybe im wrong I didn't test it yet.
[doublepost=1685885204,1685885132][/doublepost]btw for this you need tuske I think



Nah, i have it like this https://ctrlv.cz/g4yI and i need when they click on that gold that you see on picture to send that message.
 
I think this is what you need:

Code:
on inventory click:
    if inventory name of current inventory of player contains "&e&lVIP":
        if clicked slot is 11:
            if event-item is gold ingot: #or if clicked slot is slot 11 (one of the two I can't test now)
                send "message" to player
 
I think this is what you need:

Code:
on inventory click:
    if inventory name of current inventory of player contains "&e&lVIP":
        if clicked slot is 11:
            if event-item is gold ingot: #or if clicked slot is slot 11 (one of the two I can't test now)
                send "message" to player
Well, the inentory clicking register in my inventory, this one https://ctrlv.cz/WPVO and i need from this one https://ctrlv.cz/hblH :emoji_grinning:
 

Attachments

  • upload_2023-6-7_16-12-58.png
    upload_2023-6-7_16-12-58.png
    190.4 KB · Views: 229