Skocz do zawartości
  • 0

placeholderapi "if placeholder is set:"


Pytanie

Witam mam pytanie czy idzie jakoś sprawdzić, czy dany placeholder jest ustawiony 
bo mam taki placeholder %math_0:_{server_online_survival} + {server_online_lobby_nether} - {skript_onlinesurvival} % i jak wszystkie 3 są uswaione na 0 to się buguje i wyświetla to 
image.png

a tu skript i pytanie brzmi jak sprawdzić, czy {server_online_survival} i  {server_online_lobby_nether} jest ustawiony na więcej niż 0

image.png

Odnośnik do komentarza
https://skript.pl/temat/57304-placeholderapi-if-placeholder-is-set/
Udostępnij na innych stronach

5 odpowiedzi na to pytanie

Rekomendowane odpowiedzi

  • 1
on papi request for prefix "skript":
    placeholder is "skript_onlinefull"
    set {_1} to (placeholder "skript_onlinesurvival" from player parsed as number) ? 0
    set {_2} to (placeholder "server_online_survival" from player parsed as number) ? 0
    set {_3} to (placeholder "server_online_lobby_nether" from player parsed as number) ? 0
    set result to {_2} + {_3} - {_1}

 

Odnośnik do komentarza
https://skript.pl/temat/57304-placeholderapi-if-placeholder-is-set/#findComment-341483
Udostępnij na innych stronach

  • 0

Wszystko super teraz wyświetla 0 jak nikogo nie ma, ale jak jest ktoś na vanish to tak czyś jak go wyświetla a nie powinno

 

Kod:

on placeholderapi request for prefix "skript":
	if placeholder is "skript_onlinesurvival":
		loop all players:
			if loop-player's world is "survival" or "lobby_nether":
				if {vanish::%loop-player%} is true:
					set result to "%size of {vanish::%loop-player%}%"
	if placeholder is "skript_onlinefull":
		set {_1} to (placeholder "skript_onlinesurvival" from player parsed as number) ? 0
		set {_2} to (placeholder "server_online_survival" from player parsed as number) ? 0
		set {_3} to (placeholder "server_online_lobby_nether" from player parsed as number) ? 0
		set result to {_2} + {_3} - {_1}

 

Odnośnik do komentarza
https://skript.pl/temat/57304-placeholderapi-if-placeholder-is-set/#findComment-341503
Udostępnij na innych stronach

  • 1
W dniu 4.04.2024 o 08:45, Fquido_Games napisał:

Wszystko super teraz wyświetla 0 jak nikogo nie ma, ale jak jest ktoś na vanish to tak czyś jak go wyświetla a nie powinno

 

Kod:

on placeholderapi request for prefix "skript":
	if placeholder is "skript_onlinesurvival":
		loop all players:
			if loop-player's world is "survival" or "lobby_nether":
				if {vanish::%loop-player%} is true:
					set result to "%size of {vanish::%loop-player%}%"
	if placeholder is "skript_onlinefull":
		set {_1} to (placeholder "skript_onlinesurvival" from player parsed as number) ? 0
		set {_2} to (placeholder "server_online_survival" from player parsed as number) ? 0
		set {_3} to (placeholder "server_online_lobby_nether" from player parsed as number) ? 0
		set result to {_2} + {_3} - {_1}

 

on placeholderapi request for prefix "skript":
	if identifier is "onlinesurvival":
		loop all players where [input's world is "survival" or "lobby_nether"]:
			set result to (size of all players where [{vanish::%input%} is not true])
	if identifier is "onlinefull":
		set {_1} to (placeholder "skript_onlinesurvival" from player parsed as number) ? 0
		set {_2} to (placeholder "server_online_survival" from player parsed as number) ? 0
		set {_3} to (placeholder "server_online_lobby_nether" from player parsed as number) ? 0
		set result to {_2} + {_3} - {_1}

 

Odnośnik do komentarza
https://skript.pl/temat/57304-placeholderapi-if-placeholder-is-set/#findComment-341525
Udostępnij na innych stronach

  • 0
21 godzin temu, xAxee napisał:
on placeholderapi request for prefix "skript":
	if identifier is "onlinesurvival":
		loop all players where [input's world is "survival" or "lobby_nether"]:
			set result to (size of all players where [{vanish::%input%} is not true])
	if identifier is "onlinefull":
		set {_1} to (placeholder "skript_onlinesurvival" from player parsed as number) ? 0
		set {_2} to (placeholder "server_online_survival" from player parsed as number) ? 0
		set {_3} to (placeholder "server_online_lobby_nether" from player parsed as number) ? 0
		set result to {_2} + {_3} - {_1}

 

Dziękuje działa. Można zamknąć

Odnośnik do komentarza
https://skript.pl/temat/57304-placeholderapi-if-placeholder-is-set/#findComment-341543
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ę...