Skocz do zawartości
  • 0

Skrypt na randomowe skrzynki z itemami na mapie!


Pytanie

Witam czy mógł by mi ktoś napisać skrypt polegający na tym że co 30 minut na mapie pojawia się 50 skrzynek w randomowych kordach (do ustawienia max i min) i w tych skrzynkach będą przedmioty też do ustalenia

Odnośnik do komentarza
https://skript.pl/temat/41280-skrypt-na-randomowe-skrzynki-z-itemami-na-mapie/
Udostępnij na innych stronach

Rekomendowane odpowiedzi

  • 0
48 minut temu, q1zZ_ napisał:

Witam czy mógł by mi ktoś napisać skrypt polegający na tym że co 30 minut na mapie pojawia się 50 skrzynek w randomowych kordach (do ustawienia max i min) i w tych skrzynkach będą przedmioty też do ustalenia

options:
	x-min: -3000
	x-max: 3000
	z-min: -3000
	z-max: 3000
	world: world
	
on load:
	set {itemy::skrzynki::*} to 5 torch and 1 diamond sword and 4 obsidian and 7 iron ingot and 2 gold ingot and 1 emerald and potion of speed and 12 stick

every 30 minutes:
	set {_liczbaskrzynek} to 0
	while {_liczbaskrzynek} is less than 50:
		set {_x} to random integer between {@x-min} and {@x-max}
		set {_z} to random integer between {@z-min} and {@z-max}	
		set {_loc} to location at {_x}, 256, {_z} in world "{@world}"
		loop 256 times:
			if block under block at {_loc} is not air:
				remove 1 from y-coordinate of {_loc}
			else:
				exit 1 loop
		set block at {_loc} to chest
		set {_skrzynka} to block at {_loc}
		loop 10 times:
			add random item out of {itemy::skrzynki::*} to {_skrzynka}'s inventory
		add 1 to {_liczbaskrzynek}
		wait 1 tick

Sprawdź czy wszystko poprawnie działa. Proszę.

Edytowane przez Kormic
Odnośnik do komentarza
https://skript.pl/temat/41280-skrypt-na-randomowe-skrzynki-z-itemami-na-mapie/#findComment-258141
Udostępnij na innych stronach

  • 0
20 minut temu, Kormic napisał:

options:
	x-min: -3000
	x-max: 3000
	z-min: -3000
	z-max: 3000
	world: world
	
on load:
	set {itemy::skrzynki::*} to 5 torch and 1 diamond sword and 4 obsidian and 7 iron ingot and 2 gold ingot and 1 emerald and potion of speed and 12 stick

every 30 minutes:
	set {_liczbaskrzynek} to 0
	while {_liczbaskrzynek} is less than 50:
		set {_x} to random integer between {@x-min} and {@x-max}
		set {_z} to random integer between {@z-min} and {@z-max}	
		set {_loc} to location at {_x}, 256, {_z} in world "{@world}"
		loop 256 times:
			if block under {_loc} is not air:
				remove 1 from y-coordinate of {_loc}
			else:
				exit 1 loop
		if block under {_loc} is not air:
			set block at {_loc} to chest
			set {_skrzynka} to block at {_loc}
			loop 10 times:
				add random item out of {itemy::skrzynki::*} to {_skrzynka}'s inventory
			add 1 to {_liczbaskrzynek}
		wait 1 tick

Sprawdź czy wszystko poprawnie działa. Proszę.

Nie ma żądnego błędu tylko skrzynki się nie respią na mapie 

Odnośnik do komentarza
https://skript.pl/temat/41280-skrypt-na-randomowe-skrzynki-z-itemami-na-mapie/#findComment-258143
Udostępnij na innych stronach

  • 0
3 minuty temu, q1zZ_ napisał:

Nie ma żądnego błędu tylko skrzynki się nie respią na mapie 

Czy ustawiłeś odpowiedni świat? Czy ustawiłeś odpowiednie koordynaty? Bo jeśli nie, to to jest zapewne powodem.

Ustawiasz je na samej górze skryptu.

Edytowane przez Kormic
Odnośnik do komentarza
https://skript.pl/temat/41280-skrypt-na-randomowe-skrzynki-z-itemami-na-mapie/#findComment-258144
Udostępnij na innych stronach

  • 0
Teraz, Kormic napisał:

Czy ustawiłeś odpowiedni świat? Czy ustawiłeś odpowiednie koordynaty? Bo jeśli nie, to to jest zapewne powodem.

świat ustawiłem world czyli normalny jaki mam kordy ustawiłem do testu 10 na 10     
    x-min: -10
    x-max: 10
    z-min: -10
    z-max: 10

Odnośnik do komentarza
https://skript.pl/temat/41280-skrypt-na-randomowe-skrzynki-z-itemami-na-mapie/#findComment-258145
Udostępnij na innych stronach

  • 0
4 minuty temu, q1zZ_ napisał:

świat ustawiłem world czyli normalny jaki mam kordy ustawiłem do testu 10 na 10     
    x-min: -10
    x-max: 10
    z-min: -10
    z-max: 10

Poprawiłem skrypt wyżej, sprawdź jeszcze raz.

Odnośnik do komentarza
https://skript.pl/temat/41280-skrypt-na-randomowe-skrzynki-z-itemami-na-mapie/#findComment-258146
Udostępnij na innych stronach

  • 0
W dniu 24.08.2020 o 16:39, Kormic napisał:

Poprawiłem skrypt wyżej, sprawdź jeszcze raz.

Nadal tak samo

 

W dniu 24.08.2020 o 16:39, Kormic napisał:

Poprawiłem skrypt wyżej, sprawdź jeszcze raz.

Wiesz czemu tak jest?

xAxee

Łączę posty.

Notatka dodana przez xAxee

Odnośnik do komentarza
https://skript.pl/temat/41280-skrypt-na-randomowe-skrzynki-z-itemami-na-mapie/#findComment-258147
Udostępnij na innych stronach

  • 0
1 minutę temu, q1zZ_ napisał:

Wiesz czemu tak jest?

Już naprawiłem wszystko, dodałem do skryptu broadcast, abyś widział gdzie jest każda skrzynka:

Wersja dla testu:

options:
	x-min: -3000
	x-max: 3000
	z-min: -3000
	z-max: 3000
	world: world
	
on load:
	set {itemy::skrzynki::*} to 5 torch and 1 diamond sword and 4 obsidian and 7 iron ingot and 2 gold ingot and 1 emerald and potion of speed and 12 stick

command /dropskrzynek:
	trigger:
		set {_liczbaskrzynek} to 0
		while {_liczbaskrzynek} is less than 5:
			set {_x} to random integer between {@x-min} and {@x-max}
			set {_z} to random integer between {@z-min} and {@z-max}	
			set {_loc} to location at {_x}, 256, {_z} in world "{@world}"
			loop 256 times:
				if block under block at {_loc} is air:
					remove 1 from y-coordinate of {_loc}
				else:
					exit 1 loop
			set block at {_loc} to chest
			set {_skrzynka} to block at {_loc}
			broadcast "%{_loc}%"
			loop 10 times:
				add random item out of {itemy::skrzynki::*} to {_skrzynka}'s inventory
			add 1 to {_liczbaskrzynek}
			wait 1 tick

Wersja pełna:

options:
	x-min: -3000
	x-max: 3000
	z-min: -3000
	z-max: 3000
	world: world
	
on load:
	set {itemy::skrzynki::*} to 5 torch and 1 diamond sword and 4 obsidian and 7 iron ingot and 2 gold ingot and 1 emerald and potion of speed and 12 stick

every 30 minutes:
	set {_liczbaskrzynek} to 0
	while {_liczbaskrzynek} is less than 50:
		set {_x} to random integer between {@x-min} and {@x-max}
		set {_z} to random integer between {@z-min} and {@z-max}	
		set {_loc} to location at {_x}, 256, {_z} in world "{@world}"
		loop 256 times:
			if block under block at {_loc} is air:
				remove 1 from y-coordinate of {_loc}
			else:
				exit 1 loop
		set block at {_loc} to chest
		set {_skrzynka} to block at {_loc}
		loop 10 times:
			add random item out of {itemy::skrzynki::*} to {_skrzynka}'s inventory
		add 1 to {_liczbaskrzynek}
		wait 1 tick

Proszę.

Edytowane przez Kormic
Odnośnik do komentarza
https://skript.pl/temat/41280-skrypt-na-randomowe-skrzynki-z-itemami-na-mapie/#findComment-258151
Udostępnij na innych stronach

  • 0
6 minut temu, Kormic napisał:

Już naprawiłem wszystko, dodałem do skryptu broadcast, abyś widział gdzie jest każda skrzynka:

Wersja dla testu:


options:
	x-min: -3000
	x-max: 3000
	z-min: -3000
	z-max: 3000
	world: world
	
on load:
	set {itemy::skrzynki::*} to 5 torch and 1 diamond sword and 4 obsidian and 7 iron ingot and 2 gold ingot and 1 emerald and potion of speed and 12 stick

command /dropskrzynek:
	trigger:
		set {_liczbaskrzynek} to 0
		while {_liczbaskrzynek} is less than 5:
			set {_x} to random integer between {@x-min} and {@x-max}
			set {_z} to random integer between {@z-min} and {@z-max}	
			set {_loc} to location at {_x}, 256, {_z} in world "{@world}"
			loop 256 times:
				if block under block at {_loc} is air:
					remove 1 from y-coordinate of {_loc}
				else:
					exit 1 loop
			set block at {_loc} to chest
			set {_skrzynka} to block at {_loc}
			broadcast "%{_loc}%"
			loop 10 times:
				add random item out of {itemy::skrzynki::*} to {_skrzynka}'s inventory
			add 1 to {_liczbaskrzynek}
			wait 1 tick

Wersja pełna:


options:
	x-min: -3000
	x-max: 3000
	z-min: -3000
	z-max: 3000
	world: world
	
on load:
	set {itemy::skrzynki::*} to 5 torch and 1 diamond sword and 4 obsidian and 7 iron ingot and 2 gold ingot and 1 emerald and potion of speed and 12 stick

every 30 minutes:
	set {_liczbaskrzynek} to 0
	while {_liczbaskrzynek} is less than 5:
		set {_x} to random integer between {@x-min} and {@x-max}
		set {_z} to random integer between {@z-min} and {@z-max}	
		set {_loc} to location at {_x}, 256, {_z} in world "{@world}"
		loop 256 times:
			if block under block at {_loc} is air:
				remove 1 from y-coordinate of {_loc}
			else:
				exit 1 loop
		set block at {_loc} to chest
		set {_skrzynka} to block at {_loc}
		loop 10 times:
			add random item out of {itemy::skrzynki::*} to {_skrzynka}'s inventory
		add 1 to {_liczbaskrzynek}
		wait 1 tick

Proszę.

Okej działa mam jeszcze prośbę czy mógł byś dodać coś takiego że na skrzynce pisze że ta skrzyna pochodzi z eventu?

Odnośnik do komentarza
https://skript.pl/temat/41280-skrypt-na-randomowe-skrzynki-z-itemami-na-mapie/#findComment-258153
Udostępnij na innych stronach

  • 0
Teraz, q1zZ_ napisał:

Okej działa mam jeszcze prośbę czy mógł byś dodać coś takiego że na skrzynce pisze że ta skrzyna pochodzi z eventu?

Masz na myśli tabliczkę?

Odnośnik do komentarza
https://skript.pl/temat/41280-skrypt-na-randomowe-skrzynki-z-itemami-na-mapie/#findComment-258154
Udostępnij na innych stronach

  • 0
Teraz, q1zZ_ napisał:

I jak tam

Daj mi chwilę, już kończę. Muszę tylko dostawić jeden fragment kodu i za chwilę go tu wrzucę.

Edytowane przez Kormic
Odnośnik do komentarza
https://skript.pl/temat/41280-skrypt-na-randomowe-skrzynki-z-itemami-na-mapie/#findComment-258164
Udostępnij na innych stronach

  • 0
1 minutę temu, Kormic napisał:

Daj mi chwilę, już kończę. Muszę tylko dostawić jeden fragment kodu i za chwilę go tu wrzucę.

Okej a jak już to robisz to dało by jeszcze rade dodać że te skrzynki się usuną po 60 minutach? (sory że tak męczę)

Odnośnik do komentarza
https://skript.pl/temat/41280-skrypt-na-randomowe-skrzynki-z-itemami-na-mapie/#findComment-258165
Udostępnij na innych stronach

  • 0
12 minut temu, q1zZ_ napisał:

Okej a jak już to robisz to dało by jeszcze rade dodać że te skrzynki się usuną po 60 minutach? (sory że tak męczę)

options:
	x-min: -3000
	x-max: 3000
	z-min: -3000
	z-max: 3000
	world: world
	
on load:
	loop {loc::skrzynki::lista::*}:
		set block at loop-value to air
	clear {loc::skrzynki::lista::*}	
	set {itemy::skrzynki::*} to 5 torch and 1 diamond sword and 4 obsidian and 7 iron ingot and 2 gold ingot and 1 emerald and potion of speed and 12 stick
	while true:
		set {_liczbaskrzynek} to 0
		while {_liczbaskrzynek} is less than 5:
			set {_x} to random integer between {@x-min} and {@x-max}
			set {_z} to random integer between {@z-min} and {@z-max}	
			set {_loc} to location at {_x}, 256, {_z} in world "{@world}"
			loop 256 times:
				if block under block at {_loc} is air:
					remove 1 from y-coordinate of {_loc}
				else:
					exit 1 loop
			set block at {_loc} to chest
			set {_znak} to block in front of block at {_loc}
			set {_znak} to wall sign
			set line 2 of {_znak} to "To jest skrzynka"
			set line 3 of {_znak} to "z eventu!"
			set {_skrzynka} to block at {_loc}
			add location of block at {_loc} to {loc::skrzynki::lista::*}
			loop 10 times:
				add random item out of {itemy::skrzynki::*} to {_skrzynka}'s inventory
			add 1 to {_liczbaskrzynek}
		wait 30 minutes
	while true:
		loop {loc::skrzynki::lista::*}:
			set block at loop-value to air
		clear {loc::skrzynki::lista::*}
		wait 1 hour

Sprawdź czy to zadziała.

Odnośnik do komentarza
https://skript.pl/temat/41280-skrypt-na-randomowe-skrzynki-z-itemami-na-mapie/#findComment-258168
Udostępnij na innych stronach

  • 0
1 godzinę temu, Kormic napisał:

options:
	x-min: -3000
	x-max: 3000
	z-min: -3000
	z-max: 3000
	world: world
	
on load:
	loop {loc::skrzynki::lista::*}:
		set block at loop-value to air
	clear {loc::skrzynki::lista::*}	
	set {itemy::skrzynki::*} to 5 torch and 1 diamond sword and 4 obsidian and 7 iron ingot and 2 gold ingot and 1 emerald and potion of speed and 12 stick
	while true:
		set {_liczbaskrzynek} to 0
		while {_liczbaskrzynek} is less than 5:
			set {_x} to random integer between {@x-min} and {@x-max}
			set {_z} to random integer between {@z-min} and {@z-max}	
			set {_loc} to location at {_x}, 256, {_z} in world "{@world}"
			loop 256 times:
				if block under block at {_loc} is air:
					remove 1 from y-coordinate of {_loc}
				else:
					exit 1 loop
			set block at {_loc} to chest
			set {_znak} to block in front of block at {_loc}
			set {_znak} to wall sign
			set line 2 of {_znak} to "To jest skrzynka"
			set line 3 of {_znak} to "z eventu!"
			set {_skrzynka} to block at {_loc}
			add location of block at {_loc} to {loc::skrzynki::lista::*}
			loop 10 times:
				add random item out of {itemy::skrzynki::*} to {_skrzynka}'s inventory
			add 1 to {_liczbaskrzynek}
		wait 30 minutes
	while true:
		loop {loc::skrzynki::lista::*}:
			set block at loop-value to air
		clear {loc::skrzynki::lista::*}
		wait 1 hour

Sprawdź czy to zadziała.

Niby działa (sory że tak długo nie odpisywałem)

a możesz zrobić tak że to się komendą będzie usuwało?

Odnośnik do komentarza
https://skript.pl/temat/41280-skrypt-na-randomowe-skrzynki-z-itemami-na-mapie/#findComment-258175
Udostępnij na innych stronach

  • 0
34 minuty temu, q1zZ_ napisał:

Niby działa (sory że tak długo nie odpisywałem)

a możesz zrobić tak że to się komendą będzie usuwało?

options:
	x-min: -3000
	x-max: 3000
	z-min: -3000
	z-max: 3000
	world: world
	
on load:
	loop {loc::skrzynki::lista::*}:
		set block at loop-value to air
	clear {loc::skrzynki::lista::*}	
	set {itemy::skrzynki::*} to 5 torch and 1 diamond sword and 4 obsidian and 7 iron ingot and 2 gold ingot and 1 emerald and potion of speed and 12 stick
	while true:
		set {_liczbaskrzynek} to 0
		while {_liczbaskrzynek} is less than 5:
			set {_x} to random integer between {@x-min} and {@x-max}
			set {_z} to random integer between {@z-min} and {@z-max}	
			set {_loc} to location at {_x}, 256, {_z} in world "{@world}"
			loop 256 times:
				if block under block at {_loc} is air:
					remove 1 from y-coordinate of {_loc}
				else:
					exit 1 loop
			set block at {_loc} to chest
			set {_znak} to block in front of block at {_loc}
			set {_znak} to wall sign
			set line 2 of {_znak} to "To jest skrzynka"
			set line 3 of {_znak} to "z eventu!"
			set {_skrzynka} to block at {_loc}
			add location of block at {_loc} to {loc::skrzynki::lista::*}
			loop 10 times:
				add random item out of {itemy::skrzynki::*} to {_skrzynka}'s inventory
			add 1 to {_liczbaskrzynek}
		wait 30 minutes

command /resetskrzyn:
	trigger:
		loop {loc::skrzynki::lista::*}:
			set block at loop-value to air
		clear {loc::skrzynki::lista::*}
		send "&aPomyslnie zresetowano wszystkie skrzynie z eventu!" to sender

Proszę. Teraz nie będzie regularnego usuwania, będzie tylko za pomocą komendy. Jeśli chcesz, aby była możliwość taka i taka, to użyj poprzedniego kodu i z tego weź ostatnie 6 linijek (tę komendę).

Odnośnik do komentarza
https://skript.pl/temat/41280-skrypt-na-randomowe-skrzynki-z-itemami-na-mapie/#findComment-258179
Udostępnij na innych stronach

  • 0
1 minutę temu, Kormic napisał:

options:
	x-min: -3000
	x-max: 3000
	z-min: -3000
	z-max: 3000
	world: world
	
on load:
	loop {loc::skrzynki::lista::*}:
		set block at loop-value to air
	clear {loc::skrzynki::lista::*}	
	set {itemy::skrzynki::*} to 5 torch and 1 diamond sword and 4 obsidian and 7 iron ingot and 2 gold ingot and 1 emerald and potion of speed and 12 stick
	while true:
		set {_liczbaskrzynek} to 0
		while {_liczbaskrzynek} is less than 5:
			set {_x} to random integer between {@x-min} and {@x-max}
			set {_z} to random integer between {@z-min} and {@z-max}	
			set {_loc} to location at {_x}, 256, {_z} in world "{@world}"
			loop 256 times:
				if block under block at {_loc} is air:
					remove 1 from y-coordinate of {_loc}
				else:
					exit 1 loop
			set block at {_loc} to chest
			set {_znak} to block in front of block at {_loc}
			set {_znak} to wall sign
			set line 2 of {_znak} to "To jest skrzynka"
			set line 3 of {_znak} to "z eventu!"
			set {_skrzynka} to block at {_loc}
			add location of block at {_loc} to {loc::skrzynki::lista::*}
			loop 10 times:
				add random item out of {itemy::skrzynki::*} to {_skrzynka}'s inventory
			add 1 to {_liczbaskrzynek}
		wait 30 minutes

command /resetskrzyn:
	trigger:
		loop {loc::skrzynki::lista::*}:
			set block at loop-value to air
		clear {loc::skrzynki::lista::*}
		send "&aPomyslnie zresetowano wszystkie skrzynie z eventu!" to sender

Proszę. Teraz nie będzie regularnego usuwania, będzie tylko za pomocą komendy. Jeśli chcesz, aby była możliwość taka i taka, to użyj poprzedniego kodu i z tego weź ostatnie 6 linijek (tę komendę).

okej dzięki bardzo

Odnośnik do komentarza
https://skript.pl/temat/41280-skrypt-na-randomowe-skrzynki-z-itemami-na-mapie/#findComment-258180
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ę...