Skocz do zawartości
  • 0

Skrypt na skrzynie.


MikuChan
 Udostępnij

Pytanie

on rightclick:
    if player is holding tripwire hook:
        if player's target is chest:
            set {_loc} to the location at 47, 7, 212
            if location of target block is {_loc}:
                cancel event
                if name of player's tool is "&eKlucz do &5Mitycznej &eskrzynii":
                    open chest with 3 rows named "&8Skrzynia" to player
                    wait 1 tick
                    format slot 13 of player with 1 of barrier named "&7Losuję..." to be unstealable
                    wait 5 ticks
                    format slot 4 of player with 1 of red stained glass pane named "&0..." to be unstealable
                    format slot 22 of player with 1 of red stained glass pane named "&0..." to be unstealable
                    wait 5 ticks
                    format slot 3 of player with 1 of gray stained glass pane named "&0..." to be unstealable
                    format slot 5 of player with 1 of gray stained glass pane named "&0..." to be unstealable
                    format slot 21 of player with 1 of gray stained glass pane named "&0..." to be unstealable
                    format slot 23 of player with 1 of gray stained glass pane named "&0..." to be unstealable
                    wait 5 ticks
                    format slot 2 of player with 1 of gray stained glass pane named "&0..." to be unstealable
                    format slot 6 of player with 1 of gray stained glass pane named "&0..." to be unstealable
                    format slot 20 of player with 1 of gray stained glass pane named "&0..." to be unstealable
                    format slot 24 of player with 1 of gray stained glass pane named "&0..." to be unstealable
                    wait 5 ticks
                    format slot 1 of player with 1 of gray stained glass pane named "&0..." to be unstealable
                    format slot 7 of player with 1 of gray stained glass pane named "&0..." to be unstealable
                    format slot 19 of player with 1 of gray stained glass pane named "&0..." to be unstealable
                    format slot 25 of player with 1 of gray stained glass pane named "&0..." to be unstealable
                    wait 5 ticks
                    format slot 0 of player with 1 of yellow stained glass pane named "&0..." to be unstealable
                    format slot 8 of player with 1 of yellow stained glass pane named "&0..." to be unstealable
                    format slot 18 of player with 1 of yellow stained glass pane named "&0..." to be unstealable
                    format slot 26 of player with 1 of yellow stained glass pane named "&0..." to be unstealable
                    
                    
command /skrzynia:
	trigger:
		give 1 tripwire hook named "&eKlucz do &5Mitycznej &eskrzynii" to player
                    
                    

Jeszcze nie skończyłem skryptu ale chciałem go zobaczyć.

Okazało się że nic nie działa ale gdy sprawdzałem nie było żadnych błędów.

Pomocy

Odnośnik do komentarza
Udostępnij na innych stronach

9 odpowiedzi na to pytanie

Rekomendowane odpowiedzi

  • 0
1 minutę temu, MikuChan napisał:

Jeszcze nie skończyłem skryptu ale chciałem go zobaczyć.

Okazało się że nic nie działa ale gdy sprawdzałem nie było żadnych błędów.

Pomocy

Opisz co nie działa. Dodatkowo zamień format slota (który jest zbugowany i można z niego wyciągać itemy) na skriptowego set slota oraz zamień `open chest with 3 rows...' na skriptowe 'open chest inventory with 3 rows...'

Odnośnik do komentarza
Udostępnij na innych stronach

  • 0
1 minutę temu, MikuChan napisał:

Jeszcze nie skończyłem skryptu ale chciałem go zobaczyć.

Okazało się że nic nie działa ale gdy sprawdzałem nie było żadnych błędów.

Pomocy

1. Nie używaj zbugowanego 'format slot' z SkQuery do formatowania GUI. Posiada wiele błędów i jest ograniczone. Zamiast tego użyj Skripta (lub nawet TuSKe).

2. Warunek w trzeciej linijce jest źle zrobiony, gdyż gracz nie ma celu. Możesz wywalić ten warunek i użyć eventu 'on right click on chest'.

3. W 4. linijce tworzysz lokalizację, ale brakuje tam świata. Dopisz na końcu 'in world "twój_świat"'.

4. W 5. linijce porównujesz dwie lokalizacje, ale one nie są takie same, gdyż dokładna lokalizacja bloku to jego środek, a więc każdy z koordynatów powinien mieć na końcu .5.

5. Jeżeli mimo powyższych zaleceń nie zadziała, w drugiej linijce sprawdzaj czy 'type of player's tool' to 'tripwire hook'. Możesz nawet usunąć warunek w 7. linijce i połączyć go z tym w drugiej.

player's tool is tripwire hook named "jakaś nazwa":
	# Dalszy kod

 

Odnośnik do komentarza
Udostępnij na innych stronach

  • 0
on right click on chest:
    cancel event
    if player's tool is tripwire hook named "&eKlucz do &5Mitycznej &eskrzynii":
        set {_loc} to the location at -489.5, 136.5, 212.5 in world
        if location of event-block is {_loc}:
            open chest inventory with 3 rows named "&eSkrzynia" to player
            wait 1 tick
            set player's current inventory's slot 13 to barrier named "&7Losuję..."
            wait 5 ticks
            set player's current inventory's slot 4 to red stained glass pane named "&0..."
            set player's current inventory's slot 22 to red stained glass pane named "&0..."
            wait 5 ticks
            set player's current inventory's slot 3 to gray stained glass pane named "&0..."
            set player's current inventory's slot 5 to gray stained glass pane named "&0..."
            set player's current inventory's slot 21 to gray stained glass pane named "&0..."
            set player's current inventory's slot 23 to gray stained glass pane named "&0..."
            wait 5 ticks
            set player's current inventory's slot 2 to gray stained glass pane named "&0..."
            set player's current inventory's slot 6 to gray stained glass pane named "&0..."
            set player's current inventory's slot 22 to gray stained glass pane named "&0..."
            set player's current inventory's slot 24 to gray stained glass pane named "&0..."
            wait 5 ticks
            set player's current inventory's slot 1 to gray stained glass pane named "&0..."
            set player's current inventory's slot 7 to gray stained glass pane named "&0..."
            set player's current inventory's slot 19 to gray stained glass pane named "&0..."
            set player's current inventory's slot 25 to gray stained glass pane named "&0..."
            wait 5 ticks
            set player's current inventory's slot 0 to yellow stained glass pane named "&0..."
            set player's current inventory's slot 8 to yellow stained glass pane named "&0..."
            set player's current inventory's slot 18 to yellow stained glass pane named "&0..."
            set player's current inventory's slot 26 to yellow stained glass pane named "&0..."
                    
                    
command /skrzynia:
	trigger:
		give 1 tripwire hook named "&eKlucz do &5Mitycznej &eskrzynii" to player
       
on inventory click:
    if inventory name of current inventory of player is "&eSkrzynia":
        cancel event
                    
                    

Zrobiłem tak, lecz nadal nie działa. 

Działa do 2 linijki.
                    
                    

Odnośnik do komentarza
Udostępnij na innych stronach

  • 0

Hej, sprawdziłem konsolę i gdy chcę otworzyć skrzynie to wyskakuję mi to:

In 1.13+ you cannot get the title name of an inventory outside of an InventoryClickEvent, Only if this inventory has an InventoryHolder may it be used in this state.

Glicz

Poprawiam formatowanie na ciemnym motywie.

Notatka dodana przez Glicz

Odnośnik do komentarza
Udostępnij na innych stronach

  • 0
8 minut temu, MikuChan napisał:

In 1.13+ you cannot get the title name of an inventory outside of an InventoryClickEvent, Only if this inventory has an InventoryHolder may it be used in this state.

Zamień sprawdzanie nazwy inventory w on inventory click na 'if name of event-inventory is " "'. Zamiast tego skryptu zalecam użyć plugin Zarejestruj się lub zaloguj, aby zobaczyć ukrytą treść!.

Odnośnik do komentarza
Udostępnij na innych stronach

Dołącz do dyskusji

Możesz dodać zawartość już teraz a zarejestrować się później. Jeśli posiadasz już konto, zaloguj się aby dodać zawartość za jego pomocą.

Nieaktywny
Odpowiedz na pytanie...

×   Wklejono zawartość z formatowaniem.   Usuń formatowanie

  Dozwolonych jest tylko 75 emoji.

×   Odnośnik został automatycznie osadzony.   Przywróć wyświetlanie jako odnośnik

×   Przywrócono poprzednią zawartość.   Wyczyść edytor

×   Nie możesz bezpośrednio wkleić grafiki. Dodaj lub załącz grafiki z adresu URL.

 Udostępnij

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

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