REQUESTING HELP GUI on/off Panes?

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

ItsDy1an

New Member
Jun 23, 2017
8
0
0
28
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.
 
code_language.skript:
On inventory click:
    if clicked item is green stained glass pane:
        set slot clicked slot to red stained glass pane

If you're using skquery or tuske GUIs adjust accordingly
 
  • Like
Reactions: ItsDy1an
if the glass placement in the gui is static you could have it run a command that
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.
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_language.skript:
function glassChange(p: player):
    wait 1 second
    open virtual chest inventory with size 1 named "Derp" to {_p}
    if {pane_on.%{_p}%} is not set:
        set {pane_on.%{_p}%} to true
    if {pane_on.%{_p}%} is true:
        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
    if {pane_on.%{_p}%} is false:
        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
   
command testgui:
    trigger:
        send "%{pane_on.%player%}%"
        glassChange(player)
       
on inventory click:
    if inventory name of player's current inventory contains "Derp":
        clicked item is red stained glass pane or light green stained glass pane
        if {pane_on.%player%} is true:
            set {pane_on.%player%} to false
            send "made false"
            stop
        if {pane_on.%player%} is false:
            set {pane_on.%player%} to true
            send "made true"
            stop
requires Tuske and skellet if memory serves
 
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_language.skript:
function glassChange(p: player):
    wait 1 second
    open virtual chest inventory with size 1 named "Derp" to {_p}
    if {pane_on.%{_p}%} is not set:
        set {pane_on.%{_p}%} to true
    if {pane_on.%{_p}%} is true:
        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
    if {pane_on.%{_p}%} is false:
        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
  
command testgui:
    trigger:
        send "%{pane_on.%player%}%"
        glassChange(player)
      
on inventory click:
    if inventory name of player's current inventory contains "Derp":
        clicked item is red stained glass pane or light green stained glass pane
        if {pane_on.%player%} is true:
            set {pane_on.%player%} to false
            send "made false"
            stop
        if {pane_on.%player%} is false:
            set {pane_on.%player%} to true
            send "made true"
            stop
requires Tuske and skellet if memory serves
thanks for this, Gonna try it out!
 
Status
Not open for further replies.