Skocz do zawartości
  • 0

Problem || else


DeepesT

Pytanie

11 odpowiedzi na to pytanie

Rekomendowane odpowiedzi

  • 0

 

Zamiast lopowania mozesz zrobic tak:

set slot 0 and 1 and 2 and 3 and 4 and 5 and 6 and 7 and 8 and 9 and 10 and 11 and 12 and 14 and 15 and 16 and 17 and 18 and 19 and 20 and 21 and 22 and 23 and 24 and 25 and 26 of player's current inventory to black stained glass pane named " "
    if clicked inventory is player's inventory:
        stop
        cancel event

Zamien miejscami stop z cancel

execute player command "efektyzgui sila %player%"

Mozesz zrobic funkcje zamist komendy  :) 

Edytowane przez Cinu2421
Odnośnik do komentarza
https://skript.pl/temat/41535-problem-else/#findComment-260057
Udostępnij na innych stronach

  • 0
3 godziny temu, DeepesT napisał:

Witam mam problem wywala mi error przy else: Z góry dziękuję! Pozdrawiam  ---> Zdjecie ---> https://iv.pl/image/GtkymOd

Nie miałeś warunku, a w kodzie był else. Dodałem przykład z wymaganym diamentem.

command /test:
	trigger:
		open chest with 3 rows named "&cSklep" to player
		loop 27 times:
			set slot loop-number - 1 of player's current inventory to black stained glass pane named " "
		if player has 1 diamond:	
			set slot 13 of player's current inventory to stone named "&7&lSILA I" with lore "|| &aKliknij, aby kupic efekt!|| &8» &cSpecyfikacja&8:|| &8&l• &7trwanie 5 min|| &8&l• &7koszt 64 emerald blockow|| ||  &8» &aStac Cie na to!"
		else:
			set slot 13 of player's current inventory to stone named "&7&lSILA I" with lore "|| &aKliknij, aby kupic efekt!|| &8» &cSpecyfikacja&8:|| &8&l• &7trwanie 5 min|| &8&l• &7koszt 64 emerald blockow|| ||  &8» &cNie stac Cie na to!"
				
on inventory click:
	if name of player's current inventory is not "&cSklep":
		stop
	if clicked inventory is player's inventory:
		stop
	cancel event
	if clicked slot is 13:
		if player doesn't have 1 diamond:
			send "&cNie stac cie na to!" to player
			stop
		close player's inventory
		execute player command "efektyzgui sila %player%"

 

22 minuty temu, Cinu2421 napisał:

 

Zamiast lopowania mozesz zrobic tak:


set slot 0 and 1 and 2 and 3 and 4 and 5 and 6 and 7 and 8 and 9 and 10 and 11 and 12 and 14 and 15 and 16 and 17 and 18 and 19 and 20 and 21 and 22 and 23 and 24 and 25 and 26 of player's current inventory to black stained glass pane named " "

    if clicked inventory is player's inventory:
        stop
        cancel event

Zamien miejscami stop z cancel


execute player command "efektyzgui sila %player%"

Mozesz zrobic funkcje zamist komendy  :) 

To, co ty zrobiłeś, to jest herezja. Kto normalny w taki sposób ustawia sloty?

Odnośnik do komentarza
https://skript.pl/temat/41535-problem-else/#findComment-260062
Udostępnij na innych stronach

  • 0
Teraz, Kormic napisał:

Nie miałeś warunku, a w kodzie był else. Dodałem przykład z wymaganym diamentem.


command /test:
	trigger:
		open chest with 3 rows named "&cSklep" to player
		loop 27 times:
			set slot loop-number - 1 of player's current inventory to black stained glass pane named " "
		if player has 1 diamond:	
			set slot 13 of player's current inventory to stone named "&7&lSILA I" with lore "|| &aKliknij, aby kupic efekt!|| &8» &cSpecyfikacja&8:|| &8&l• &7trwanie 5 min|| &8&l• &7koszt 64 emerald blockow|| ||  &8» &aStac Cie na to!"
		else:
			set slot 13 of player's current inventory to stone named "&7&lSILA I" with lore "|| &aKliknij, aby kupic efekt!|| &8» &cSpecyfikacja&8:|| &8&l• &7trwanie 5 min|| &8&l• &7koszt 64 emerald blockow|| ||  &8» &cNie stac Cie na to!"
				
on inventory click:
	if name of player's current inventory is not "&cSklep":
		stop
	if clicked inventory is player's inventory:
		stop
	cancel event
	if clicked slot is 13:
		if player doesn't have 1 diamond:
			send "&cNie stac cie na to!" to player
			stop
		close player's inventory
		execute player command "efektyzgui sila %player%"

 

To, co ty zrobiłeś, to jest herezja. Kto normalny w taki sposób ustawia sloty?

Ja tak ustawiam xD

Napisalem tylko ze zamiast loopowania moze to zrobic

Wydaje mi sie ze jak ktos odpali dobre makro i z 3 mc to moze mu serwer tym lopowaniem wywalic ale moge sie mylic

Odnośnik do komentarza
https://skript.pl/temat/41535-problem-else/#findComment-260064
Udostępnij na innych stronach

  • 0
4 minuty temu, Cinu2421 napisał:

Ja tak ustawiam xD

Napisalem tylko ze zamiast loopowania moze to zrobic

Wydaje mi sie ze jak ktos odpali dobre makro i z 3 mc to moze mu serwer tym lopowaniem wywalic ale moge sie mylic

1. W takim razie naucz się używania pętli.

2. Lepiej aby czegoś takiego nie używał, takie setowanie po primo wygląda okropnie, po drugie nie ma nic wspólnego z wydajnością skryptu, a po trzecie zmniejsza drastycznie czytelność kodu.

3. Wtedy może wywalić takiego gracza za pakiety, zresztą z loopowaniem czy bez i tak efekt jest taki sam. Poza tym czymś takim nie wywalisz serwera.

Edytowane przez Kormic
Odnośnik do komentarza
https://skript.pl/temat/41535-problem-else/#findComment-260065
Udostępnij na innych stronach

  • 0
35 minut temu, Cinu2421 napisał:

Zamiast lopowania mozesz zrobic tak:


set slot 0 and 1 and 2 and 3 and 4 and 5 and 6 and 7 and 8 and 9 and 10 and 11 and 12 and 14 and 15 and 16 and 17 and 18 and 19 and 20 and 21 and 22 and 23 and 24 and 25 and 26 of player's current inventory to black stained glass pane named " "

 

pokażę ci sztuczkę - tylko patrz uważnie:

set slot (integers from 0 to 26) of player to diamond

 

 

 

a ogólnie do robienia GUI polecam zapoznać się z tym:

 

Edytowane przez PanMaruda
Odnośnik do komentarza
https://skript.pl/temat/41535-problem-else/#findComment-260066
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ę...