Skocz do zawartości
  • 0

Skrypt na kompas pokazujący najdalszego gracza


Kebaberon
 Udostępnij

Pytanie

3 odpowiedzi na to pytanie

Rekomendowane odpowiedzi

  • 0
43 minuty temu, Kebaberon napisał:

Witam mam prośbę czy da rade stworzyć skrypt który kompasem będzie pokazywał najdalszego gracza?

command /kompas:
	trigger:
		give player compass named "&6&lNawigator"
		
on join:
	while player is online:
		if player's tool is compass named "&6&lNawigator":
			loop all players in player's world:
				if loop-player is not player:
					if {_t} is not set:
						set {_t} to location of the loop-player
						set {_p} to loop-player
					if distance between player and loop-player is greater than distance between player and {_t}:
						set {_t} to location of the loop-player
						set {_p} to loop-player
			if {_t} is not set:
				send "&cNie ma zadnego gracza poza toba w tym swiecie!" to player
			else:
				set player's compass target to location of block at {_t}
				set {_d} to distance between player and {_t} rounded to 1 decimal place
				send "&aNajdalszy gracz: %{_p}%, dystans: %{_d}%" to player
		wait 3 seconds

Sprawdź czy wszystko poprawnie działa.

EDIT:

Jest też druga wersja:

command /kompas:
	trigger:
		give player compass named "&6&lNawigator"
		while player is online:
			if player's tool is compass named "&6&lNawigator":
				if {cooldown::kompas::%player%} is not set:
					loop all players in player's world:
						if loop-player is not player:
							if {_t} is not set:
								set {_t} to location of the loop-player
								set {_p} to loop-player
							if distance between player and loop-player is greater than distance between player and {_t}:
								set {_t} to location of the loop-player
								set {_p} to loop-player
					if {_t} is not set:
						send "&cNie ma zadnego gracza poza toba w tym swiecie!" to player
					else:
						set player's compass target to location of block at {_t}
						set {_d} to distance between player and {_t} rounded to 1 decimal place
						send "&aNajdalszy gracz: %{_p}%, dystans: %{_d}%" to player
			wait 5 seconds
			clear {cooldown::kompas::%player%}

 

Edytowane przez Kormic
Odnośnik do komentarza
Udostępnij na innych stronach

  • 0
17 minut temu, Kebaberon napisał:

Nie działa ani to pierwsze ani drugie ://

Wersja Skripta?

EDIT:

Zapewne chodzi o to, że masz wersję Skripta, która nie wie czym są pętle 'while', więc masz wersję, która powinna ci zadziałać:

command /kompas:
	trigger:
		give player compass named "&6&lNawigator"
		
on right click with compass:
	if player's tool is compass named "&6&lNawigator":
		if {cooldown::kompas::%player%} is not set:
			set {cooldown::kompas::%player%} to true
			loop all players in player's world:
				if loop-player is not player:
					if {_t} is not set:
						set {_t} to location of the loop-player
						set {_p} to loop-player
					if distance between player and loop-player is greater than distance between player and {_t}:
						set {_t} to location of the loop-player
						set {_p} to loop-player
			if {_t} is not set:
				send "&cNie ma zadnego gracza poza toba w tym swiecie!" to player
			else:
				set player's compass target to location of block at {_t}
				set {_d} to distance between player and {_t} rounded to 1 decimal place
				send "&aNajdalszy gracz: %{_p}%, dystans: %{_d}%" to player
			wait 5 seconds
			clear {cooldown::kompas::%player%}
		else:
			send "&cMusisz odczekac chwile!" to player

 

Edytowane przez Kormic
Odnośnik do komentarza
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.

 Udostępnij

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

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