Skocz do zawartości
  • 0

Problem ze skryptem na "DISCO ZBROJE"


R4VD0R
 Udostępnij

Pytanie

Mam problem ze skryptem po dodaniu go do skryptów i po przeładowaniu go w grze nie wyskakuje żaden błąd ani w konsoli ani na czacie.

 

 

variables:
    {disco::player} = "OFF"
    
command /disco <text>:
    trigger:
        if argument is "wlacz" or "on":
            if {disco::%player%} is "OFF":
                set {disco::%player%} to "ON"
                send "&bTwoja &5DISCO&6ZBROJA &bzostala &2WLACZONA&b&l!" to player
            else:
                send "&cTwoja &5DISCO&6ZBROJA &cjest juz &2WLACZONA&c&l!" to player
        if argument is "wylacz" or "off":
            if {disco::%player%} is "ON":
                set {disco::%player%} to "OFF"
                send "&bTwoja &5DISCO&6ZBROJA &bzostala &4WLACZONA&b&l!" to player
                
command /discomenu:
    trigger:
        open chest with 1 row named "&5&lDISCO&6&lZBROJA" to player 
        format slot 2 of player with 1 emerald named "&5&lDISCO&6&lZBROJA &2&lON" with lore "&7Status&8: &8&l(&b%{disco::%player%}%&8&l)" to close then run [make player execute command "/disco on"]
        format slot 6 of player with 1 redstone named "&5&lDISCO&6&lZBROJA &4&lOFF" with lore "&7Status&8: &8&l(&b%{disco::%player%}%&8&l)" to close then run [make player execute command "/disco on"]
              
every 5 seconds:
    if {disco::%player%} is "ON":
        chance of 25%:
            equip player with diamond helmet
        chance of 25%:
            equip player with iron helmet
        chance of 25%:
            equip player with gold helmet
        chance of 25%:
            equip player with leather helmet
    else:
        stop


 

:
    {disco::player} = "OFF"
    
command /disco <text>:
    trigger:
        if argument is "wlacz" or "on":
            if {disco::%player%} is "OFF":
                set {disco::%player%} to "ON"
                send "&bTwoja &5DISCO&6ZBROJA &bzostala &2WLACZONA&b&l!" to player
            else:
                send "&cTwoja &5DISCO&6ZBROJA &cjest juz &2WLACZONA&c&l!" to player
        if argument is "wylacz" or "off":
            if {disco::%player%} is "ON":
                set {disco::%player%} to "OFF"
                send "&bTwoja &5DISCO&6ZBROJA &bzostala &4WLACZONA&b&l!" to player
                
command /discomenu:
    trigger:
        open chest with 1 row named "&5&lDISCO&6&lZBROJA" to player 
        format slot 2 of player with 1 emerald named "&5&lDISCO&6&lZBROJA &2&lON" with lore "&7Status&8: &8&l(&b%{disco::%player%}%&8&l)" to close then run [make player execute command "/disco on"]
        format slot 6 of player with 1 redstone named "&5&lDISCO&6&lZBROJA &4&lOFF" with lore "&7Status&8: &8&l(&b%{disco::%player%}%&8&l)" to close then run [make player execute command "/disco on"]
              
every 5 seconds:
    if {disco::%player%} is "ON":
        chance of 25%:
            equip player with diamond helmet
        chance of 25%:
            equip player with iron helmet
        chance of 25%:
            equip player with gold helmet
        chance of 25%:
            equip player with leather helmet
    else:
        stop

 

Edytowane przez xNightPower_
Nieaktywny

Umieszczam kod w code.

Odnośnik do komentarza
Udostępnij na innych stronach

3 odpowiedzi na to pytanie

Rekomendowane odpowiedzi

  • 0
2 minuty temu, R4VD0R napisał:

Mam problem ze skryptem po dodaniu go do skryptów i po przeładowaniu go w grze nie wyskakuje żaden błąd ani w konsoli ani na czacie.

1. Błąd w drugiej linijce, użyłeś 'player' zamiast '%player%' w nazwie zmiennej.

2. Linijka 21. - podałeś złą komendę, 'on' zastąp 'off'.

3. W periodicalu bezpośrednio użyłeś gracza, co jest niedopuszczalne. Nie można tego zrobić, gdyż jest to fragment kodu, który jest wykonywany co jakąś jednostkę czasu. Dlatego też nie ma tam gracza, aby go przechwycić, należy zapętlić wszystkich graczy na serwerze i zamiast 'player', użyć 'loop-player'. Dodam, że blok 'else' w tym periodicalu jest zbędny.

EDIT:

Jeszcze jedno... jeżeli jest to możliwe i wersja Skripta ci na to pozwala, użyj formatowania GUI ze Skripta, a formatowanie poprzez SkQuery porzuć, gdyż jest możliwe do zbugowania. 

Edytowane przez Kormic
Odnośnik do komentarza
Udostępnij na innych stronach

Nieaktywny
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.
 Udostępnij

  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...