Skocz do zawartości
  • 0

Kozaczekkw

Pytanie

Witam, jestem w trakcie pisania skryptu na Bossy, chcę aby komenda Boss wykonywała się, co  2 minuty. Próbowałem ale coś nie działa.

Ps, czasem boss pojawi się na wodzie, też chciałbym, aby ktoś to poprawił.

Z góry dzięki za pomoc.

 

command /Boss [<text>]:
	trigger:
		set {_X} to random integer between {@XMax} and {@XMin}
		set {_Y} to {@Y}
		set {_Z} to random integer between {@ZMax} and {@ZMin}
		set {_Tp.Boss} to location at {_X}, {_Y}, {_Z}
		if biome at {_Tp.Boss} is not ocean or river or deep ocean:
			loop blocks under {_Tp.Boss}:
				if loop-block is not water or lava or air:
					set {_Tp.Boss} to location at {_X}, loop-block's y-location+1, {_Z}
					create an explosion of force 4 at {_Tp.Boss}
					spawn a Zombie at {_Tp.Boss}
					set max health of last spawned Zombie to 100
					heal last spawned Zombie
					set name of the spawned Zombie to "&6Test %spawned Zombie's health%/%max health of last spawned Zombie%"
					set helmet of the spawned Zombie to diamond helmet of protection 10 and unbreaking 10
					set chestplate of the spawned Zombie to diamond chestplate of protection 10 and unbreaking 10
					set leggings of the spawned Zombie to diamond leggings of protection 10 and unbreaking 10
					set boots of the spawned Zombie to diamond boots of protection 10 and unbreaking 10
					set tool of the spawned Zombie to a diamond sword of sharpness 9 and fire aspect 4
					send "%{_Tp.Boss}%" to all players
					exit loop
					stop


every 2 minute in "world":
	execute console command "Boss"

 

Edytowane przez Kozaczekkw
Odnośnik do komentarza
https://skript.pl/temat/34659-boss/
Udostępnij na innych stronach

12 odpowiedzi na to pytanie

Rekomendowane odpowiedzi

  • 0
command /Boss [<text>]:
	executable by: console
	trigger:
		set {_X} to random integer between {@XMax} and {@XMin}
		set {_Y} to {@Y}
		set {_Z} to random integer between {@ZMax} and {@ZMin}
		set {_Tp.Boss} to location at {_X}, {_Y}, {_Z}
		if biome at {_Tp.Boss} is not ocean or river or deep ocean:
			loop blocks under {_Tp.Boss}:
				if loop-block is not water or lava or air:
					set {_Tp.Boss} to location at {_X}, loop-block's y-location+1, {_Z}
					create an explosion of force 4 at {_Tp.Boss}
					spawn a Zombie at {_Tp.Boss}
					set max health of last spawned Zombie to 100
					heal last spawned Zombie
					set name of the spawned Zombie to "&6Test %spawned Zombie's health%/%max health of last spawned Zombie%"
					set helmet of the spawned Zombie to diamond helmet of protection 10 and unbreaking 10
					set chestplate of the spawned Zombie to diamond chestplate of protection 10 and unbreaking 10
					set leggings of the spawned Zombie to diamond leggings of protection 10 and unbreaking 10
					set boots of the spawned Zombie to diamond boots of protection 10 and unbreaking 10
					set tool of the spawned Zombie to a diamond sword of sharpness 9 and fire aspect 4
					send "%{_Tp.Boss}%" to all players
					exit loop
					stop


every 2 minute:
	execute console command "Boss"

 

Odnośnik do komentarza
https://skript.pl/temat/34659-boss/#findComment-222961
Udostępnij na innych stronach

  • 0

@xAxee

 

Nadal nie działa, co prawda nie ma błedów.

 

Options:
	XMax: 2000
	XMin: -2000
	Y: 156
	ZMax: 2000
	ZMin: -2000
	Czas.Boss: 2
	Spr.Boss: 1

command /Boss [<text>]:
	executable by: console
	trigger:
		set {_X} to random integer between {@XMax} and {@XMin}
		set {_Y} to {@Y}
		set {_Z} to random integer between {@ZMax} and {@ZMin}
		set {_Tp.Boss} to location at {_X}, {_Y}, {_Z}	
		send "1" to all players
		if biome at {_Tp.Boss} is not ocean or river or deep ocean:
			send "2" to all players
			loop blocks under {_Tp.Boss}:
				if loop-block is not water or lava or air:
					set {_Tp.Boss} to location at {_X}, loop-block's y-location+1, {_Z}
					send "2" to all players
					create an explosion of force 4 at {_Tp.Boss}
					spawn a Zombie at {_Tp.Boss}
					set max health of last spawned Zombie to 100
					heal last spawned Zombie
					set name of the spawned Zombie to "&6Test %spawned Zombie's health%/%max health of last spawned Zombie%"
					set helmet of the spawned Zombie to diamond helmet of protection 10 and unbreaking 10
					set chestplate of the spawned Zombie to diamond chestplate of protection 10 and unbreaking 10
					set leggings of the spawned Zombie to diamond leggings of protection 10 and unbreaking 10
					set boots of the spawned Zombie to diamond boots of protection 10 and unbreaking 10
					set tool of the spawned Zombie to a diamond sword of sharpness 9 and fire aspect 4
					send "%{_Tp.Boss}%" to all players
					Send "3" to all players
					exit loop
					stop


every second:
	execute console command "Boss"

Dodałem wiadomości send to all players, 

Wysyła jedynki, ale 2 już nie.

Odnośnik do komentarza
https://skript.pl/temat/34659-boss/#findComment-223006
Udostępnij na innych stronach

  • 0
W dniu 25.08.2019 o 21:39, Kozaczekkw napisał:

@xAxee

 

Nadal nie działa, co prawda nie ma błedów.

 


Options:
	XMax: 2000
	XMin: -2000
	Y: 156
	ZMax: 2000
	ZMin: -2000
	Czas.Boss: 2
	Spr.Boss: 1

command /Boss [<text>]:
	executable by: console
	trigger:
		set {_X} to random integer between {@XMax} and {@XMin}
		set {_Y} to {@Y}
		set {_Z} to random integer between {@ZMax} and {@ZMin}
		set {_Tp.Boss} to location at {_X}, {_Y}, {_Z}	
		send "1" to all players
		if biome at {_Tp.Boss} is not ocean or river or deep ocean:
			send "2" to all players
			loop blocks under {_Tp.Boss}:
				if loop-block is not water or lava or air:
					set {_Tp.Boss} to location at {_X}, loop-block's y-location+1, {_Z}
					send "2" to all players
					create an explosion of force 4 at {_Tp.Boss}
					spawn a Zombie at {_Tp.Boss}
					set max health of last spawned Zombie to 100
					heal last spawned Zombie
					set name of the spawned Zombie to "&6Test %spawned Zombie's health%/%max health of last spawned Zombie%"
					set helmet of the spawned Zombie to diamond helmet of protection 10 and unbreaking 10
					set chestplate of the spawned Zombie to diamond chestplate of protection 10 and unbreaking 10
					set leggings of the spawned Zombie to diamond leggings of protection 10 and unbreaking 10
					set boots of the spawned Zombie to diamond boots of protection 10 and unbreaking 10
					set tool of the spawned Zombie to a diamond sword of sharpness 9 and fire aspect 4
					send "%{_Tp.Boss}%" to all players
					Send "3" to all players
					exit loop
					stop


every second:
	execute console command "Boss"

Dodałem wiadomości send to all players, 

Wysyła jedynki, ale 2 już nie.

Usuń tego ifa z biomem bo potem już sprawdzasz czy jest to woda

Odnośnik do komentarza
https://skript.pl/temat/34659-boss/#findComment-223184
Udostępnij na innych stronach

  • 0
2 godziny temu, xAxee napisał:

Usuń tego ifa z biomem bo potem już sprawdzasz czy jest to woda

@xAxee

 

 

 

Options:
	XMax: 2000
	XMin: -2000
	Y: 156
	ZMax: 2000
	ZMin: -2000
	Czas.Boss: 2
	Spr.Boss: 1

command /Boss [<text>]:
	executable by: console
	trigger:
		set {_X} to random integer between {@XMax} and {@XMin}
		set {_Y} to {@Y}
		set {_Z} to random integer between {@ZMax} and {@ZMin}
		set {_Tp.Boss} to location at {_X}, {_Y}, {_Z}	
		send "1" to all players
		if biome at {_Tp.Boss} is not ocean or river or deep ocean:
			send "2" to all players
			loop blocks under {_Tp.Boss}:
				if loop-block is not water or lava or air:
					set {_Tp.Boss} to location at {_X}, loop-block's y-location+1, {_Z}
					send "2" to all players
					create an explosion of force 4 at {_Tp.Boss}
					spawn a Zombie at {_Tp.Boss}
					set max health of last spawned Zombie to 100
					heal last spawned Zombie
					set name of the spawned Zombie to "&6Test %spawned Zombie's health%/%max health of last spawned Zombie%"
					set helmet of the spawned Zombie to diamond helmet of protection 10 and unbreaking 10
					set chestplate of the spawned Zombie to diamond chestplate of protection 10 and unbreaking 10
					set leggings of the spawned Zombie to diamond leggings of protection 10 and unbreaking 10
					set boots of the spawned Zombie to diamond boots of protection 10 and unbreaking 10
					set tool of the spawned Zombie to a diamond sword of sharpness 9 and fire aspect 4
					send "%{_Tp.Boss}%" to all players
					Send "3" to all players
					exit loop
					stop


every second:
	execute console command "Boss"

Usunąłem, niestety nadal nie wysyła "2" 

Odnośnik do komentarza
https://skript.pl/temat/34659-boss/#findComment-223210
Udostępnij na innych stronach

  • 0

Dziwisz się, że nie wysyła? Jedną dwójkę wysyła, drugiej dwójki i trójki nie wysyła.

Jest to spowodowane tym, że komendę wysyła konsola (tylko!) i gdy pobierasz lokację _tp.Boss to wtedy masz tylko XYZ, a komputer nie wie na którym świecie, więc gdy próbujesz wziąć w pętle bloki, to wtedy nie ma tam żadnych bloków i kod się zatrzymuje, bo również nie ma dalszego kodu na tym tabie.

set {_Tp.Boss} to location at {_X}, {_Y}, {_Z} in world "world"

Tu masz poprawione.

 

//Masz jeszcze problem z lokalizacją.

set y-location of {_Tp.Boss} to y-location of loop-block + 1

zamiast

Cytat

set {_Tp.Boss} to location at {_X}, loop-block's y-location+1, {_Z}

Ci powiem, ciężki do zabija jest ten mob na minecraftowych przedmiotach wymaksowanych enchantem :P 

Edytowane przez knugi
Odnośnik do komentarza
https://skript.pl/temat/34659-boss/#findComment-223449
Udostępnij na innych stronach

  • 0
6 minut temu, knugi napisał:

Dziwisz się, że nie wysyła? Jedną dwójkę wysyła, drugiej dwójki i trójki nie wysyła.

Jest to spowodowane tym, że komendę wysyła konsola (tylko!) i gdy pobierasz lokację _tp.Boss to wtedy masz tylko XYZ, a komputer nie wie na którym świecie, więc gdy próbujesz wziąć w pętle bloki, to wtedy nie ma tam żadnych bloków i kod się zatrzymuje, bo również nie ma dalszego kodu na tym tabie.


set {_Tp.Boss} to location at {_X}, {_Y}, {_Z} in world "world"

Tu masz poprawione.

 

Bardzo Ci dziękuje za pomoc.

 

Temat do zamknięcia.

Odnośnik do komentarza
https://skript.pl/temat/34659-boss/#findComment-223456
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ę...