variables: {Gui.Open.%player%} = false command /gui []: permission: gui.open trigger: set {Gui.Open.%player-arg%} to true set {R.%name of player%} to arg 1 open chest with 1 rows named "&cOdblokuj gre" to player arg wait 0.2 second format slot 4 of player arg with 1 of diamond named "&aKliknij by odblokowac!" to close then run [execute console command "sudo %{R.%name of player%}% guizakoncz"] on inventory close: wait 0.2 second if {Gui.Open.%player%} is true: set {Gui.Open.%player%} to true wait 0.3 second execute console command "gui %{R.%name of player%}%" else: set {Gui.Open.%player%} to false command /guizakoncz: trigger: if {Gui.Open.%player%} is true: set {Gui.Open.%player%} to false send "&aOdblokowales sie!"