Skocz do zawartości
  • 0

GUI kity


Ciasnyelo1

Pytanie

Siemka. Potrzebuje skryptu który polega na tym ze gdy grasz wpisze komendę /kit to otwiera mu się skrzynia z 2 rzędami na górze są ikony kitów a na dole są zielone wełny lub czerwone jeżeli gracz posiada do kitu permisje to jest wełna jest zielona natomiast gdy nie ma permisji wełna jest czerwona.

Edytowane przez Ciasnyelo1
Odnośnik do komentarza
https://skript.pl/temat/40948-gui-kity/
Udostępnij na innych stronach

8 odpowiedzi na to pytanie

Rekomendowane odpowiedzi

  • 0
25 minut temu, Ciasnyelo1 napisał:

Siemka. Potrzebuje skryptu który polega na tym ze gdy grasz wpisze komendę /kit to otwiera mu się skrzynia z 2 rzędami na górze są ikony kitów a na dole są zielone wełny lub czerwone jeżeli gracz posiada do kitu permisje to jest wełna jest zielona natomiast gdy nie ma permisji wełna jest czerwona.

command /kit:
	trigger:
		open chest with 2 rows named "&6&lKity"
		
		set slot 0 of player's current inventory to sword named "Rycerz"
		if player has permission "kity.rycerz":
			set slot 9 of player's current inventory to lime wool named "&aMasz dostep!"
		else:
			set slot 9 of player's current inventory to red wool named "&cNie masz dostepu!"
			
		set slot 1 of player's current inventory to bow named "Lucznik"
		if player has permission "kity.lucznik":
			set slot 10 of player's current inventory to lime wool named "&aMasz dostep!"
		else:
			set slot 10 of player's current inventory to red wool named "&cNie masz dostepu!"
		
		set slot 2 of player's current inventory to bricks named "Budowniczy"
		if player has permission "kity.budowniczy":
			set slot 11 of player's current inventory to lime wool named "&aMasz dostep!"
		else:
			set slot 11 of player's current inventory to red wool named "&cNie masz dostepu!"
			
on inventory click:
	if name of player's current inventory is "&6&lKity":
		if clicked slot is between 0 and 8:
			cancel event
			if clicked slot is 0:
				#twoj kod
			if clicked slot is 1:
				#twoj kod
			if clicked slot is 2:
				#twoj kod
		else:
			cancel event

Proszę. Powinno wszystko ładnie działać. Dałem ci przykładowe 3 kity.

EDIT:

U góry powinno być 'open chest with 2 rows named "&6&lKity" to player'. :)

Edytowane przez Kormic
Odnośnik do komentarza
https://skript.pl/temat/40948-gui-kity/#findComment-255204
Udostępnij na innych stronach

  • 0
W dniu 9.08.2020 o 22:15, Kormic napisał:

command /kit:
	trigger:
		open chest with 2 rows named "&6&lKity"
		
		set slot 0 of player's current inventory to sword named "Rycerz"
		if player has permission "kity.rycerz":
			set slot 9 of player's current inventory to lime wool named "&aMasz dostep!"
		else:
			set slot 9 of player's current inventory to red wool named "&cNie masz dostepu!"
			
		set slot 1 of player's current inventory to bow named "Lucznik"
		if player has permission "kity.lucznik":
			set slot 10 of player's current inventory to lime wool named "&aMasz dostep!"
		else:
			set slot 10 of player's current inventory to red wool named "&cNie masz dostepu!"
		
		set slot 2 of player's current inventory to bricks named "Budowniczy"
		if player has permission "kity.budowniczy":
			set slot 11 of player's current inventory to lime wool named "&aMasz dostep!"
		else:
			set slot 11 of player's current inventory to red wool named "&cNie masz dostepu!"
			
on inventory click:
	if name of player's current inventory is "&6&lKity":
		if clicked slot is between 0 and 8:
			cancel event
			if clicked slot is 0:
				#twoj kod
			if clicked slot is 1:
				#twoj kod
			if clicked slot is 2:
				#twoj kod
		else:
			cancel event

Proszę. Powinno wszystko ładnie działać. Dałem ci przykładowe 3 kity.

EDIT:

U góry powinno być 'open chest with 2 rows named "&6&lKity" to player'. :)

 Empty configuration section! You might want to indent one or more of the subsequent lines to make them belong to this section or remove the colon at the end of the line if you don't want this line to start a section. (kity.sk, line 27: if clicked slot is 0:')
> [20:40:19 WARN]: Empty configuration section! You might want to indent one or more of the subsequent lines to make them belong to this section or remove the colon at the end of the line if you don't want this line to start a section. (kity.sk, line 29: if clicked slot is 1:')
> [20:40:19 WARN]: Empty configuration section! You might want to indent one or more of the subsequent lines to make them belong to this section or remove the colon at the end of the line if you don't want this line to start a section. (kity.sk, line 31: if clicked slot is 2:')
> [20:40:19 ERROR]: Can't understand this condition/effect: open chest with 2 rows named "&6&lKity" (kity.sk, line 3: open chest with 2 rows named "&6&lKity"')
> [20:40:19 ERROR]: Can't compare a slot with ('between 0' and '8') (kity.sk, line 25: if clicked slot is between 0 and 8:')
> [20:40:19 ERROR]: 'else' has to be placed just after an 'if' or 'else if' section (kity.sk, line 33: else:')

 

 
Edytowane przez xAxee
xAxee

Wstawiam w code

Notatka dodana przez xAxee

Odnośnik do komentarza
https://skript.pl/temat/40948-gui-kity/#findComment-255219
Udostępnij na innych stronach

  • 0
W dniu 9.08.2020 o 22:42, Ciasnyelo1 napisał:

 Empty configuration section! You might want to indent one or more of the subsequent lines to make them belong to this section or remove the colon at the end of the line if you don't want this line to start a section. (kity.sk, line 27: if clicked slot is 0:')
> [20:40:19 WARN]: Empty configuration section! You might want to indent one or more of the subsequent lines to make them belong to this section or remove the colon at the end of the line if you don't want this line to start a section. (kity.sk, line 29: if clicked slot is 1:')
> [20:40:19 WARN]: Empty configuration section! You might want to indent one or more of the subsequent lines to make them belong to this section or remove the colon at the end of the line if you don't want this line to start a section. (kity.sk, line 31: if clicked slot is 2:')
> [20:40:19 ERROR]: Can't understand this condition/effect: open chest with 2 rows named "&6&lKity" (kity.sk, line 3: open chest with 2 rows named "&6&lKity"')
> [20:40:19 ERROR]: Can't compare a slot with ('between 0' and '8') (kity.sk, line 25: if clicked slot is between 0 and 8:')
> [20:40:19 ERROR]: 'else' has to be placed just after an 'if' or 'else if' section (kity.sk, line 33: else:')

 

 

1. To jest poprawna wersja:

command /kit:
	trigger:
		open chest with 2 rows named "&6&lKity" to player
		
		set slot 0 of player's current inventory to sword named "Rycerz"
		if player has permission "kity.rycerz":
			set slot 9 of player's current inventory to lime wool named "&aMasz dostep!"
		else:
			set slot 9 of player's current inventory to red wool named "&cNie masz dostepu!"
			
		set slot 1 of player's current inventory to bow named "Lucznik"
		if player has permission "kity.lucznik":
			set slot 10 of player's current inventory to lime wool named "&aMasz dostep!"
		else:
			set slot 10 of player's current inventory to red wool named "&cNie masz dostepu!"
		
		set slot 2 of player's current inventory to bricks named "Budowniczy"
		if player has permission "kity.budowniczy":
			set slot 11 of player's current inventory to lime wool named "&aMasz dostep!"
		else:
			set slot 11 of player's current inventory to red wool named "&cNie masz dostepu!"
			
on inventory click:
	if name of player's current inventory is "&6&lKity":
		if clicked slot is between 0 and 8:
			cancel event
			if clicked slot is 0:
				send "1"
			if clicked slot is 1:
				send "2"
			if clicked slot is 2:
				send "3"
		else:
			cancel event

2. Podaj wersję Skripta oraz silnik i wersję serwera.

3. W 'if clicked slot is (numer):' masz dać sobie swój kod.

Edytowane przez xAxee
xAxee

Poprawiam cytat

Notatka dodana przez xAxee

Odnośnik do komentarza
https://skript.pl/temat/40948-gui-kity/#findComment-255222
Udostępnij na innych stronach

  • 0
W dniu 9.08.2020 o 22:46, Kormic napisał:

1. To jest poprawna wersja:


command /kit:
	trigger:
		open chest with 2 rows named "&6&lKity" to player
		
		set slot 0 of player's current inventory to sword named "Rycerz"
		if player has permission "kity.rycerz":
			set slot 9 of player's current inventory to lime wool named "&aMasz dostep!"
		else:
			set slot 9 of player's current inventory to red wool named "&cNie masz dostepu!"
			
		set slot 1 of player's current inventory to bow named "Lucznik"
		if player has permission "kity.lucznik":
			set slot 10 of player's current inventory to lime wool named "&aMasz dostep!"
		else:
			set slot 10 of player's current inventory to red wool named "&cNie masz dostepu!"
		
		set slot 2 of player's current inventory to bricks named "Budowniczy"
		if player has permission "kity.budowniczy":
			set slot 11 of player's current inventory to lime wool named "&aMasz dostep!"
		else:
			set slot 11 of player's current inventory to red wool named "&cNie masz dostepu!"
			
on inventory click:
	if name of player's current inventory is "&6&lKity":
		if clicked slot is between 0 and 8:
			cancel event
			if clicked slot is 0:
				send "1"
			if clicked slot is 1:
				send "2"
			if clicked slot is 2:
				send "3"
		else:
			cancel event

2. Podaj wersję Skripta oraz silnik i wersję serwera.

3. W 'if clicked slot is (numer):' masz dać sobie swój kod.

Teraz tak:

> [20:52:11 ERROR]: Can't compare a slot with ('between 0' and '8') (kity.sk, line 25: if clicked slot is between 0 and 8:')
> [20:52:11 ERROR]: 'else' has to be placed just after an 'if' or 'else if' section (kity.sk, line 33: else:')

 

skript: 2.2-dev36

wersja 1.8.8

Edytowane przez xAxee
xAxee

Wstawiam w code, poprawiam formatowanie 

Notatka dodana przez xAxee

Odnośnik do komentarza
https://skript.pl/temat/40948-gui-kity/#findComment-255227
Udostępnij na innych stronach

  • 0
W dniu 9.08.2020 o 22:55, Ciasnyelo1 napisał:

Teraz tak:


> [20:52:11 ERROR]: Can't compare a slot with ('between 0' and '8') (kity.sk, line 25: if clicked slot is between 0 and 8:')
> [20:52:11 ERROR]: 'else' has to be placed just after an 'if' or 'else if' section (kity.sk, line 33: else:')

 

skript: 2.2-dev36

wersja 1.8.8

Podejrzewam, że 'clicked slot is between' może pochodzić ze Skelletta. Wybacz, że tak to zrobiłem, ale spróbuj pobrać Skelletta i sprawdź, czy nadal jest błąd.

Edytowane przez xAxee
xAxee

Poprawiam cytat

Notatka dodana przez xAxee

Odnośnik do komentarza
https://skript.pl/temat/40948-gui-kity/#findComment-255232
Udostępnij na innych stronach

  • 0
2 minuty temu, Kormic napisał:

Podejrzewam, że 'clicked slot is between' może pochodzić ze Skelletta. Wybacz, że tak to zrobiłem, ale spróbuj pobrać Skelletta i sprawdź, czy nadal jest błąd.

Działa wszystko. Dzięki 😛

 

Odnośnik do komentarza
https://skript.pl/temat/40948-gui-kity/#findComment-255233
Udostępnij na innych stronach

Nieaktywny
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.
  • Ostatnio przeglądający   0 użytkowników

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