Skocz do zawartości
  • 0

Weryfikacja


Nefiu

Pytanie

[11:09:32] [Server thread/INFO]: [Skript] Reloading weryfikacja.sk...

[11:09:32] [Server thread/ERROR]: Can't compare 'player's current inventory's slot slot' with an item type (weryfikacja.sk, line 12: if player's current inventory's slot slot is not light green wool named "&aKliknij":')

[11:09:32] [Server thread/INFO]: [Skript] Encountered 1 error while reloading weryfikacja.sk!

 

Skrypt:

 

 

on join:
    open chest with 3 rows named "&cPrzejdz weryfikacje" to player
    loop 27 times:
        set player's current inventory's slot loop-number - 1 to gray glass pane named ""
    set player's current inventory's slot (random integer between 0 and 27) to light green wool named "&aKliknij"
on inventory close:
    if inventory name of current inventory of player is "&cPrzejdz weryfikacje":
        kick player due to "musisz kliknac zielona welne"
on inventory click:
    if inventory name of current inventory of player is "&cPrzejdz weryfikacje":
        cancel event
        if player's current inventory's slot slot is not light green wool named "&aKliknij":
            kick player due to "musisz kliknac zielona welne"
            stop
        close player's inventory

 

Edytowane przez Wojciu
Wojciu

Dodaje kod w znacznik code.

Notatka dodana przez Wojciu

Odnośnik do komentarza
https://skript.pl/temat/41358-weryfikacja/
Udostępnij na innych stronach

11 odpowiedzi na to pytanie

Rekomendowane odpowiedzi

  • 0
10 godzin temu, Nefiu napisał:

[11:09:32] [Server thread/INFO]: [Skript] Reloading weryfikacja.sk...

[11:09:32] [Server thread/ERROR]: Can't compare 'player's current inventory's slot slot' with an item type (weryfikacja.sk, line 12: if player's current inventory's slot slot is not light green wool named "&aKliknij":')

[11:09:32] [Server thread/INFO]: [Skript] Encountered 1 error while reloading weryfikacja.sk!

 

Skrypt:

 

 


on join:
    open chest with 3 rows named "&cPrzejdz weryfikacje" to player
    loop 27 times:
        set player's current inventory's slot loop-number - 1 to gray glass pane named ""
    set player's current inventory's slot (random integer between 0 and 27) to light green wool named "&aKliknij"
on inventory close:
    if inventory name of current inventory of player is "&cPrzejdz weryfikacje":
        kick player due to "musisz kliknac zielona welne"
on inventory click:
    if inventory name of current inventory of player is "&cPrzejdz weryfikacje":
        cancel event
        if player's current inventory's slot slot is not light green wool named "&aKliknij":
            kick player due to "musisz kliknac zielona welne"
            stop
        close player's inventory

 

Spróbuj z tym skryptem:

on join:
	open chest with 3 rows named "&cPrzejdz weryfikacje" to player
	loop 27 times:
		set player's current inventory's slot loop-number - 1 to gray stained glass pane named " "
	set player's current inventory's slot (random integer between 0 and 27) to lime wool named "&aKliknij"
	
on inventory close:
	if inventory name of current inventory of player is "&cPrzejdz weryfikacje":
		kick player due to "musisz kliknac zielona welne"
		
on inventory click:
	if name of player's current inventory is not "&cPrzejdz weryfikacje":
		stop
	if clicked inventory is not player's inventory:
		stop
	cancel event
	if clicked item is not lime wool named "&aKliknij":
		kick player due to "&cMusisz kliknac zielona welne!"
		stop
	close player's inventory

 

Edytowane przez xAxee
xAxee

Poprawiam cytat.

Notatka dodana przez xAxee

Odnośnik do komentarza
https://skript.pl/temat/41358-weryfikacja/#findComment-258729
Udostępnij na innych stronach

  • 0
10 godzin temu, Kormic napisał:

Spróbuj z tym skryptem:


on join:
	open chest with 3 rows named "&cPrzejdz weryfikacje" to player
	loop 27 times:
		set player's current inventory's slot loop-number - 1 to gray stained glass pane named " "
	set player's current inventory's slot (random integer between 0 and 27) to lime wool named "&aKliknij"
	
on inventory close:
	if inventory name of current inventory of player is "&cPrzejdz weryfikacje":
		kick player due to "musisz kliknac zielona welne"
		
on inventory click:
	if name of player's current inventory is not "&cPrzejdz weryfikacje":
		stop
	if clicked inventory is not player's inventory:
		stop
	cancel event
	if clicked item is not lime wool named "&aKliknij":
		kick player due to "&cMusisz kliknac zielona welne!"
		stop
	close player's inventory

 

[11:19:55] [Server thread/INFO]: [Skript] Reloading weryfikacja.sk...

[11:19:55] [Server thread/ERROR]: Can't compare 'clicked item' with an item type (weryfikacja.sk, line 17: if clicked item is not lime wool named "&aKliknij":')

[11:19:55] [Server thread/INFO]: [Skript] Encountered 1 error while reloading weryfikacja.sk!

 

Edytowane przez Wojciu
Odnośnik do komentarza
https://skript.pl/temat/41358-weryfikacja/#findComment-258730
Udostępnij na innych stronach

  • 0
21 minut temu, Nefiu napisał:

[11:19:55] [Server thread/INFO]: [Skript] Reloading weryfikacja.sk...

[11:19:55] [Server thread/ERROR]: Can't compare 'clicked item' with an item type (weryfikacja.sk, line 17: if clicked item is not lime wool named "&aKliknij":')

[11:19:55] [Server thread/INFO]: [Skript] Encountered 1 error while reloading weryfikacja.sk!

Dziwne, u mnie to działa. W takim razie spróbuj z tym:

on join:
	open chest with 3 rows named "&cPrzejdz weryfikacje" to player
	loop 27 times:
		set player's current inventory's slot loop-number - 1 to gray stained glass pane named " "
	set player's current inventory's slot (random integer between 0 and 27) to lime wool named "&aKliknij"
	
on inventory close:
	if inventory name of current inventory of player is "&cPrzejdz weryfikacje":
		kick player due to "musisz kliknac zielona welne"
		
on inventory click:
	if name of player's current inventory is not "&cPrzejdz weryfikacje":
		stop
	if clicked inventory is player's inventory:
		stop
	cancel event
	set {_s} to clicked slot
	if slot {_s} of player's current inventory is not lime wool named "&aKliknij":
		kick player due to "&cMusisz kliknac zielona welne!"
		stop
	close player's inventory

 

Edytowane przez Kormic
Odnośnik do komentarza
https://skript.pl/temat/41358-weryfikacja/#findComment-258731
Udostępnij na innych stronach

  • 0
14 minut temu, Kormic napisał:

Dziwne, u mnie to działa. W takim razie spróbuj z tym:


on join:
	open chest with 3 rows named "&cPrzejdz weryfikacje" to player
	loop 27 times:
		set player's current inventory's slot loop-number - 1 to gray stained glass pane named " "
	set player's current inventory's slot (random integer between 0 and 27) to lime wool named "&aKliknij"
	
on inventory close:
	if inventory name of current inventory of player is "&cPrzejdz weryfikacje":
		kick player due to "musisz kliknac zielona welne"
		
on inventory click:
	if name of player's current inventory is not "&cPrzejdz weryfikacje":
		stop
	if clicked inventory is not player's inventory:
		stop
	cancel event
	set {_s} to clicked slot
	if slot {_s} of player's current inventory is not lime wool named "&aKliknij":
		kick player due to "&cMusisz kliknac zielona welne!"
		stop
	close player's inventory

 

Już prawie, nie pokazuje błędu ale jak klikam na wełnę to nic się nie dzieje, a gdy kliknę na jaki kolwiek slot to wtedy można podnieść item.

Odnośnik do komentarza
https://skript.pl/temat/41358-weryfikacja/#findComment-258733
Udostępnij na innych stronach

  • 0
Teraz, Nefiu napisał:

Już prawie, nie pokazuje błędu ale jak klikam na wełnę to nic się nie dzieje, a gdy kliknę na jaki kolwiek slot to wtedy można podnieść item.

A, mój błąd. Poprawiłem skrypt wyżej.

Odnośnik do komentarza
https://skript.pl/temat/41358-weryfikacja/#findComment-258734
Udostępnij na innych stronach

  • 0
27 minut temu, Nefiu napisał:

tylko jak kliknę zieloną wełnę to też mnie wyrzuca

Poprawiłem skrypt, już wszystko działa.

on join:
	wait 1 tick
	open chest with 3 rows named "&cPrzejdz weryfikacje" to player
	loop 27 times:
		set player's current inventory's slot loop-number - 1 to gray stained glass pane named " "
	set player's current inventory's slot (random integer between 0 and 27) to lime wool named "&aKliknij"
	
on inventory close:
	if name of current inventory of player is not "&cPrzejdz weryfikacje":
		stop
	if {zamykanie::inventory::%player%} is set:
		stop
	kick player due to "&cMusisz kliknac zielona welne!"
		
on inventory click:
	if name of player's current inventory is not "&cPrzejdz weryfikacje":
		stop
	if clicked inventory is player's inventory:
		stop
	cancel event
	if slot clicked slot of player's current inventory is not lime wool named "&aKliknij":
		kick player due to "&cMusisz kliknac zielona welne!"
		stop
	set {zamykanie::inventory::%player%} to true	
	close player's inventory
	clear {zamykanie::inventory::%player%}

 

Odnośnik do komentarza
https://skript.pl/temat/41358-weryfikacja/#findComment-258739
Udostępnij na innych stronach

  • 0
W dniu 28.08.2020 o 12:16, Kormic napisał:

Poprawiłem skrypt, już wszystko działa.


on join:
	wait 1 tick
	open chest with 3 rows named "&cPrzejdz weryfikacje" to player
	loop 27 times:
		set player's current inventory's slot loop-number - 1 to gray stained glass pane named " "
	set player's current inventory's slot (random integer between 0 and 27) to lime wool named "&aKliknij"
	
on inventory close:
	if name of current inventory of player is not "&cPrzejdz weryfikacje":
		stop
	if {zamykanie::inventory::%player%} is set:
		stop
	kick player due to "&cMusisz kliknac zielona welne!"
		
on inventory click:
	if name of player's current inventory is not "&cPrzejdz weryfikacje":
		stop
	if clicked inventory is player's inventory:
		stop
	cancel event
	if slot clicked slot of player's current inventory is not lime wool named "&aKliknij":
		kick player due to "&cMusisz kliknac zielona welne!"
		stop
	set {zamykanie::inventory::%player%} to true	
	close player's inventory
	clear {zamykanie::inventory::%player%}

 

[12:19:58] [Server thread/INFO]: [Skript] Reloading weryfikacja.sk...
[12:19:58] [Server thread/ERROR]: the clicked slot is not a number (weryfikacja.sk, line 21: if slot clicked slot of player's current inventory is not lime wool named "&aKliknij":')
[12:19:58] [Server thread/INFO]: [Skript] Encountered 1 error while reloading weryfikacja.sk!

 

Edytowane przez Wojciu
Odnośnik do komentarza
https://skript.pl/temat/41358-weryfikacja/#findComment-258742
Udostępnij na innych stronach

  • 0
2 minuty temu, Nefiu napisał:

[12:19:58] [Server thread/INFO]: [Skript] Reloading weryfikacja.sk...

[12:19:58] [Server thread/ERROR]: the clicked slot is not a number (weryfikacja.sk, line 21: if slot clicked slot of player's current inventory is not lime wool named "&aKliknij":')

[12:19:58] [Server thread/INFO]: [Skript] Encountered 1 error while reloading weryfikacja.sk!

Spróbuj:

(clicked slot parsed as integer)

 

Odnośnik do komentarza
https://skript.pl/temat/41358-weryfikacja/#findComment-258743
Udostępnij na innych stronach

  • 0
8 godzin temu, Kormic napisał:

Spróbuj:


(clicked slot parsed as integer)

czyli slot konwertowany na liczbę przyrównany do przedmiotu z nazwą... yes
2aTP3SS.jpg?1

 

nie sprawdzałem czy jakieś addony to dodają, ale to co poniżej będzie ze skript-mirror / skript-reflect


albo może najpierw zacznijmy od tego co zawiera 'clicked slot', otóż zawiera wszystkie informacje o danym slocie - numer, typ slotu oraz właściciela:

%inventory slot% %integer% of %inventory holder%
przykładowo:

crafting slot 2 of inventory of player
armour slot 1 of inventory of player

 

jak pobrać numer slotu:

inventory click:
	send "%event.getSlot()%"

	#to zwraca liczbę więc można przyrównywać z liczbami
	if event.getSlot() is between 0 and 10:
		send "kliknąłeś slot o numerze między 0 a 10"

 

jak pobrać przedmiot ze slotu:

inventory click:
	send "%event.getCurrentItem()%"

	#zwraca przedmiot więc można przyrównywać z przedmiotami:
	if event.getCurrentItem() is equal to potato item or carrot item:
		send "kliknąłeś kartofla lub marchew"

 

Edytowane przez PanMaruda
Odnośnik do komentarza
https://skript.pl/temat/41358-weryfikacja/#findComment-258804
Udostępnij na innych stronach

  • 0

@PanMaruda Jak to, przecież clicked slot może być również uznany za integera, bez tego nie działby chociażby warunek:

if clicked slot is <integer>:

Jeśli się mimo wszystko mylę to zwracam honor i prosiłbym, aby mnie wyprowadzić z błędu.

Edytowane przez Kormic
Odnośnik do komentarza
https://skript.pl/temat/41358-weryfikacja/#findComment-258813
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.

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

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