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

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

REQUESTING HELP GUI on/off Panes?

Discussion in 'Skript' started by ItsDy1an, Jul 26, 2017.

Thread Status:
Not open for further replies.
  1. ItsDy1an

    ItsDy1an New Member

    Joined:
    Jun 23, 2017
    Messages:
    8
    Likes Received:
    0
    Hey, So does anyone know if this is possible you're GUI panel is open and you want to activate something when you press the Green pane it switches to a Red pane.
     
  2. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    227
    Code (Skript):
    1. On inventory click:
    2.     if clicked item is green stained glass pane:
    3.         set slot clicked slot to red stained glass pane
    If you're using skquery or tuske GUIs adjust accordingly
     
    • Like Like x 1
  3. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    227
    if the glass placement in the gui is static you could have it run a command that
    It's not as efficient as Donut's but I spent the past half hour trying to get it to work so I'll post it anywayXD
    Code (Skript):
    1. function glassChange(p: player):
    2.     wait 1 second
    3.     open virtual chest inventory with size 1 named "Derp" to {_p}
    4.     if {pane_on.%{_p}%} is not set:
    5.         set {pane_on.%{_p}%} to true
    6.     if {pane_on.%{_p}%} is true:
    7.         format gui slot 3 of {_p} with light green stained glass pane named "green pane" with lore "right click to make red" to run function glassChange({_p}) with right click
    8.     if {pane_on.%{_p}%} is false:
    9.         format gui slot 3 of {_p} with red stained glass pane named "red pane" with lore "right click to make green" to run function glassChange({_p}) with right click
    10.    
    11. command testgui:
    12.     trigger:
    13.         send "%{pane_on.%player%}%"
    14.         glassChange(player)
    15.        
    16. on inventory click:
    17.     if inventory name of player's current inventory contains "Derp":
    18.         clicked item is red stained glass pane or light green stained glass pane
    19.         if {pane_on.%player%} is true:
    20.             set {pane_on.%player%} to false
    21.             send "made false"
    22.             stop
    23.         if {pane_on.%player%} is false:
    24.             set {pane_on.%player%} to true
    25.             send "made true"
    26.             stop
    27.            
    requires Tuske and skellet if memory serves
     
  4. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    227
    thanks for this, Gonna try it out!
     
    • Friendly Friendly x 1
Thread Status:
Not open for further replies.

Share This Page

Loading...