Toggle şekilde kod nasıl yapabilirim?

SheepNetwork

Ağaç Yumruklayıcı
En iyi cevaplar
0
Başlıkta belirttiğim gibi
HTML:
format slot 1 of player with 399 named "&cSohbeti Aç/Kapat" with lore "asd" to close then run [execute server command "/shcm sohbetdurumu"]
kod "/shcm sohbetdurumu" olacak 1 kere basıldıgında sohbet kapanıcak "shcm kapat" 2. basılmada "shcm ac" olacak ondan sonraki tıklamalarda bu döngü devam edecek bunu nasıl yapabilirim? öğretirmisiniz skriptte yeniyim :)
 

Blueyescat

Bedrock Kaşifi
En iyi cevaplar
0
Kod:
if {sohbetKapalı::%player%} is not set:
    make gui slot 1 of player with nether star named "&cSohbeti Kapat" with lore "asd" to run:
        close player's inventory
        set {sohbetKapalı::%player%} to true
        send "Kapatıldı"
else:
    make gui slot 1 of player with nether star named "&aSohbeti Aç" with lore "asd" to run:
        close player's inventory
        delete {sohbetKapalı::%player%}
        send "Açıldı"
TuSKe GUI Yöneticisi kullanır. SkQuery kullanmayı ne kadar erken bırakırsan o kadar iyi. Rehber konusu: https://forum.gamer.com.tr/konu/tuske-gui-yoeneticisi-rehberi.361481/

Skriptin diğer kısımlarında if {sohbetKapalı::%player%} is set: şeklinde oyuncunun sohbetinin kapalı olduğunu anlayabilirsin.
 

SheepNetwork

Ağaç Yumruklayıcı
En iyi cevaplar
0
Kod:
if {sohbetKapalı::%player%} is not set:
    make gui slot 1 of player with nether star named "&cSohbeti Kapat" with lore "asd" to run:
        close player's inventory
        set {sohbetKapalı::%player%} to true
        send "Kapatıldı"
else:
    make gui slot 1 of player with nether star named "&aSohbeti Aç" with lore "asd" to run:
        close player's inventory
        delete {sohbetKapalı::%player%}
        send "Açıldı"
TuSKe GUI Yöneticisi kullanır. SkQuery kullanmayı ne kadar erken bırakırsan o kadar iyi. Rehber konusu: https://forum.gamer.com.tr/konu/tuske-gui-yoeneticisi-rehberi.361481/

Skriptin diğer kısımlarında if {sohbetKapalı::%player%} is set: şeklinde oyuncunun sohbetinin kapalı olduğunu anlayabilirsin.
Çok teşekkür ederim fakat yeniyim mantığı anladım ama bu kodu hangi kısıma yazacağım?
Kod:
else if arg 1 is "menu" or "gui":
                if player has permission "sohbet":
                    open chest with 3 rows named "MENU/GUI" to player
                    wait 3 ticks
                    format slot 0 of player with 399 named "&cSohbeti Sil" with lore "asd" to close then run [execute player command "/shcm sil"]
                    format slot 1 of player with 399 named "&cSohbeti Aç/Kapat" with lore "asd" to close then run [execute server command "/shcm sohbetdurumu"]
 

Blueyescat

Bedrock Kaşifi
En iyi cevaplar
0
open chest yerine
Kod:
open virtual chest inventory with size 3 named "MENU" to player
wait 3 ticks'i kaldır gereksiz ve format slot satırları yerine tam olarak verdiğim kodu yapıştır.
 

SheepNetwork

Ağaç Yumruklayıcı
En iyi cevaplar
0
open chest yerine
Kod:
open virtual chest inventory with size 3 named "MENU" to player
wait 3 ticks'i kaldır gereksiz ve format slot satırları yerine tam olarak verdiğim kodu yapıştır.
Kod:
uncuprefix} sohbet normale d├Ând├╝"')
[20:24:32 ERROR]: undefined option {@serverisim} (sheepchatmanager.sk, line 47: message "&c{@serverisim} &6MineTurk"')
[20:24:32 ERROR]: 'virtual chest inventory with size 3 named "MENU"' is not an entity type (sheepchatmanager.sk, line 65: open virtual chest inventory with size 3 named "MENU" to player')
[20:24:32 ERROR]: '"asd" to run' is not a text (sheepchatmanager.sk, line 67: make gui slot 1 of player with nether star named "&cSohbeti Kapat" with lore "asd" to run:')
[20:24:32 ERROR]: '"asd" to run' is not a text (sheepchatmanager.sk, line 72: make gui slot 1 of player with nether star named "&aSohbeti A├ğ" with lore "asd" to run:')
[20:24:32 ERROR]: can't understand this event: 'if {sohbetKapal─▒::%player%} is not set' (sheepchatmanager.sk, line 77: if {sohbetKapal─▒::%player%} is not set:')
[20:24:32 ERROR]: can't understand this event: 'else' (sheepchatmanager.sk, line 82: else:')

Kod:
uncuprefix} sohbet normale d├Ând├╝"')
[20:24:32 ERROR]: undefined option {@serverisim} (sheepchatmanager.sk, line 47: message "&c{@serverisim} &6********"')
[20:24:32 ERROR]: 'virtual chest inventory with size 3 named "MENU"' is not an entity type (sheepchatmanager.sk, line 65: open virtual chest inventory with size 3 named "MENU" to player')
[20:24:32 ERROR]: '"asd" to run' is not a text (sheepchatmanager.sk, line 67: make gui slot 1 of player with nether star named "&cSohbeti Kapat" with lore "asd" to run:')
[20:24:32 ERROR]: '"asd" to run' is not a text (sheepchatmanager.sk, line 72: make gui slot 1 of player with nether star named "&aSohbeti A├ğ" with lore "asd" to run:')
[20:24:32 ERROR]: can't understand this event: 'if {sohbetKapal─▒::%player%} is not set' (sheepchatmanager.sk, line 77: if {sohbetKapal─▒::%player%} is not set:')
[20:24:32 ERROR]: can't understand this event: 'else' (sheepchatmanager.sk, line 82: else:')
Tuske yüklü.

Kod:
uncuprefix} sohbet normale d├Ând├╝"')
[20:24:32 ERROR]: undefined option {@serverisim} (sheepchatmanager.sk, line 47: message "&c{@serverisim} &6********"')
[20:24:32 ERROR]: 'virtual chest inventory with size 3 named "MENU"' is not an entity type (sheepchatmanager.sk, line 65: open virtual chest inventory with size 3 named "MENU" to player')
[20:24:32 ERROR]: '"asd" to run' is not a text (sheepchatmanager.sk, line 67: make gui slot 1 of player with nether star named "&cSohbeti Kapat" with lore "asd" to run:')
[20:24:32 ERROR]: '"asd" to run' is not a text (sheepchatmanager.sk, line 72: make gui slot 1 of player with nether star named "&aSohbeti A├ğ" with lore "asd" to run:')
[20:24:32 ERROR]: can't understand this event: 'if {sohbetKapal─▒::%player%} is not set' (sheepchatmanager.sk, line 77: if {sohbetKapal─▒::%player%} is not set:')
[20:24:32 ERROR]: can't understand this event: 'else' (sheepchatmanager.sk, line 82: else:')


Tuske yüklü.
Sen yukardaki koda ekleyip gösteremezmisin hacı yapamadım.

open chest yerine
Kod:
open virtual chest inventory with size 3 named "MENU" to player
wait 3 ticks'i kaldır gereksiz ve format slot satırları yerine tam olarak verdiğim kodu yapıştır.
Kod:
else if arg 1 is "menu" or "gui":
                if player has permission "sohbet":
                    open virtual chest inventory with size 3 named "MENU" to player
                    if {sohbetKapalı::%player%} is not set:
                        make gui slot 1 of player with nether star named "&cSohbeti Kapat" with lore "asd" to run:
                            close player's inventory
                            set {sohbetKapalı::%player%} to true
                            send "Kapatıldı"
                else:
                    make gui slot 1 of player with nether star named "&aSohbeti Aç" with lore "asd" to run:
                    close player's inventory
                    delete {sohbetKapalı::%player%}
                    send "Açıldı"

BU Kodun üstüne yazarsan sevinirim :/
 
Üst