Skocz do zawartości
  • 0

Licznik wszystkich zniszczonych bloków.


MrDivo

Pytanie

czesc, pisze poniewaz mam prosbe aby ktos mi napisal skrypt podobny do tego co jest na filmiku czas 1:48.

wystarczy tylko ze tabela bedzie ciagle widoczna i na komende mozna resetowac licznik do 0

Blocks: 0 do min. 100M (chce żeby licznik sie nie zerował po wyłaczeniu serwera)

Odnośnik do komentarza
Udostępnij na innych stronach

13 odpowiedzi na to pytanie

Rekomendowane odpowiedzi

  • 0
on break of any blocks:
    add 1 to {bloki::%player%}

every 5 seconds:
    set {topka::*} to createTop("bloki", 10, "&7[INDEX] &6[PLAYER]&7: &e[VALUE]")

on placeholderapi placeholder request for the prefix "topka":
    if the identifier is "bloki":
        set the result to "%{topka::*}%"
#dodaj placeholder na scoreboardzie {topka_bloki}

function createTop(name: string, size: integer, format: string="[P] - [V]") :: strings:
    set {_indices::*} to all indices of {%{_name}%::*}
    set {_index} to 1
    if {_size} = 0:
        return ""
    if {_size} < 0:
        set {_reversed} to true
        set {_size} to ({_size} * (-1))
    loop {_indices::*}:
        if {%{_name}%::%loop-value%} = number or timespan or date:
            set {_values::%{_index}%} to {%{_name}%::%loop-value%}
            set {_indexes::%{_index}%} to "%loop-value%"
            add 1 to {_index}
    if {_size} > (size of {_indexes::*}):
        set {_size} to (size of {_indexes::*})
    loop {_size} times:
        loop {_values::*}:
            if {_max} is not set:
                set {_max} to loop-value-2
                set {_index} to loop-index
            else:
                if {_reversed} is not true:
                    if loop-value-2 > {_max}:
                        set {_max} to loop-value-2
                        set {_index} to loop-index
                else:
                    if loop-value-2 < {_max}:
                        set {_max} to loop-value-2
                        set {_index} to loop-index
        set {_var} to {_format}
        replace "[VALUE]" and "[V]" with "%{_max}%" in {_var}
        replace "[INDEX]" and "[I]" with "%loop-number%" in {_var}
        replace "[PLAYER]" and "[P]" with {_indexes::%{_index}%} in {_var}
        add {_var} to {_return::*}
        delete {_indexes::%{_index}%}, {_values::%{_index}%}, {_max} and {_index}
    return {_return::*}

zastosowałem tutaj funkcję pyraTop Reborn
nie wiem czy działa ale sprawdź

Odnośnik do komentarza
Udostępnij na innych stronach

  • 0
W dniu 22.10.2021 o 22:32, hbrt napisał:
on break of any blocks:
    add 1 to {bloki::%player%}

every 5 seconds:
    set {topka::*} to createTop("bloki", 10, "&7[INDEX] &6[PLAYER]&7: &e[VALUE]")

on placeholderapi placeholder request for the prefix "topka":
    if the identifier is "bloki":
        set the result to "%{topka::*}%"
#dodaj placeholder na scoreboardzie {topka_bloki}

function createTop(name: string, size: integer, format: string="[P] - [V]") :: strings:
    set {_indices::*} to all indices of {%{_name}%::*}
    set {_index} to 1
    if {_size} = 0:
        return ""
    if {_size} < 0:
        set {_reversed} to true
        set {_size} to ({_size} * (-1))
    loop {_indices::*}:
        if {%{_name}%::%loop-value%} = number or timespan or date:
            set {_values::%{_index}%} to {%{_name}%::%loop-value%}
            set {_indexes::%{_index}%} to "%loop-value%"
            add 1 to {_index}
    if {_size} > (size of {_indexes::*}):
        set {_size} to (size of {_indexes::*})
    loop {_size} times:
        loop {_values::*}:
            if {_max} is not set:
                set {_max} to loop-value-2
                set {_index} to loop-index
            else:
                if {_reversed} is not true:
                    if loop-value-2 > {_max}:
                        set {_max} to loop-value-2
                        set {_index} to loop-index
                else:
                    if loop-value-2 < {_max}:
                        set {_max} to loop-value-2
                        set {_index} to loop-index
        set {_var} to {_format}
        replace "[VALUE]" and "[V]" with "%{_max}%" in {_var}
        replace "[INDEX]" and "[I]" with "%loop-number%" in {_var}
        replace "[PLAYER]" and "[P]" with {_indexes::%{_index}%} in {_var}
        add {_var} to {_return::*}
        delete {_indexes::%{_index}%}, {_values::%{_index}%}, {_max} and {_index}
    return {_return::*}

zastosowałem tutaj funkcję pyraTop Reborn
nie wiem czy działa ale sprawdź

W 1 i 5 linice pokazuje mi ze jest błąd

on break of any blocks:

on placeholderapi placeholder request for the prefix "topka":

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

  • 0
6 godzin temu, MrDivo napisał:

W 1 i 5 linice pokazuje mi ze jest błąd

na przyszłość wysyłaj ss błędów, lub ich kopię z konsoli
 

on block break:
    add 1 to {bloki::%player%}

every 5 seconds:
    set {topka::*} to createTop("bloki", 10, "&7[INDEX] &6[PLAYER]&7: &e[VALUE]")

on placeholder request with prefix "topka":
    if the identifier is "bloki":
        set the result to "%{topka::*}%"
#dodaj placeholder na scoreboardzie {topka_bloki}

function createTop(name: string, size: integer, format: string="[P] - [V]") :: strings:
    set {_indices::*} to all indices of {%{_name}%::*}
    set {_index} to 1
    if {_size} = 0:
        return ""
    if {_size} < 0:
        set {_reversed} to true
        set {_size} to ({_size} * (-1))
    loop {_indices::*}:
        if {%{_name}%::%loop-value%} = number or timespan or date:
            set {_values::%{_index}%} to {%{_name}%::%loop-value%}
            set {_indexes::%{_index}%} to "%loop-value%"
            add 1 to {_index}
    if {_size} > (size of {_indexes::*}):
        set {_size} to (size of {_indexes::*})
    loop {_size} times:
        loop {_values::*}:
            if {_max} is not set:
                set {_max} to loop-value-2
                set {_index} to loop-index
            else:
                if {_reversed} is not true:
                    if loop-value-2 > {_max}:
                        set {_max} to loop-value-2
                        set {_index} to loop-index
                else:
                    if loop-value-2 < {_max}:
                        set {_max} to loop-value-2
                        set {_index} to loop-index
        set {_var} to {_format}
        replace "[VALUE]" and "[V]" with "%{_max}%" in {_var}
        replace "[INDEX]" and "[I]" with "%loop-number%" in {_var}
        replace "[PLAYER]" and "[P]" with {_indexes::%{_index}%} in {_var}
        add {_var} to {_return::*}
        delete {_indexes::%{_index}%}, {_values::%{_index}%}, {_max} and {_index}
    return {_return::*}

spróbuj teraz

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

  • 0
W dniu 24.10.2021 o 21:21, hbrt napisał:

na przyszłość wysyłaj ss błędów, lub ich kopię z konsoli
 

on block break:
    add 1 to {bloki::%player%}

every 5 seconds:
    set {topka::*} to createTop("bloki", 10, "&7[INDEX] &6[PLAYER]&7: &e[VALUE]")

on placeholder request with prefix "topka":
    if the identifier is "bloki":
        set the result to "%{topka::*}%"
#dodaj placeholder na scoreboardzie {topka_bloki}

function createTop(name: string, size: integer, format: string="[P] - [V]") :: strings:
    set {_indices::*} to all indices of {%{_name}%::*}
    set {_index} to 1
    if {_size} = 0:
        return ""
    if {_size} < 0:
        set {_reversed} to true
        set {_size} to ({_size} * (-1))
    loop {_indices::*}:
        if {%{_name}%::%loop-value%} = number or timespan or date:
            set {_values::%{_index}%} to {%{_name}%::%loop-value%}
            set {_indexes::%{_index}%} to "%loop-value%"
            add 1 to {_index}
    if {_size} > (size of {_indexes::*}):
        set {_size} to (size of {_indexes::*})
    loop {_size} times:
        loop {_values::*}:
            if {_max} is not set:
                set {_max} to loop-value-2
                set {_index} to loop-index
            else:
                if {_reversed} is not true:
                    if loop-value-2 > {_max}:
                        set {_max} to loop-value-2
                        set {_index} to loop-index
                else:
                    if loop-value-2 < {_max}:
                        set {_max} to loop-value-2
                        set {_index} to loop-index
        set {_var} to {_format}
        replace "[VALUE]" and "[V]" with "%{_max}%" in {_var}
        replace "[INDEX]" and "[I]" with "%loop-number%" in {_var}
        replace "[PLAYER]" and "[P]" with {_indexes::%{_index}%} in {_var}
        add {_var} to {_return::*}
        delete {_indexes::%{_index}%}, {_values::%{_index}%}, {_max} and {_index}
    return {_return::*}

spróbuj teraz

[Skript] Reloading kop.sk...

can't understand this event: 'on placeholder request with prefix "topka" (kop.sk, line 7: on placeholder request with prefix "topka":')

[Skript] Encountered 1 error while reloading kop.sk!

 

W dniu 22.10.2021 o 22:32, hbrt napisał:
on break of any blocks:
    add 1 to {bloki::%player%}

every 5 seconds:
    set {topka::*} to createTop("bloki", 10, "&7[INDEX] &6[PLAYER]&7: &e[VALUE]")

on placeholderapi placeholder request for the prefix "topka":
    if the identifier is "bloki":
        set the result to "%{topka::*}%"
#dodaj placeholder na scoreboardzie {topka_bloki}

function createTop(name: string, size: integer, format: string="[P] - [V]") :: strings:
    set {_indices::*} to all indices of {%{_name}%::*}
    set {_index} to 1
    if {_size} = 0:
        return ""
    if {_size} < 0:
        set {_reversed} to true
        set {_size} to ({_size} * (-1))
    loop {_indices::*}:
        if {%{_name}%::%loop-value%} = number or timespan or date:
            set {_values::%{_index}%} to {%{_name}%::%loop-value%}
            set {_indexes::%{_index}%} to "%loop-value%"
            add 1 to {_index}
    if {_size} > (size of {_indexes::*}):
        set {_size} to (size of {_indexes::*})
    loop {_size} times:
        loop {_values::*}:
            if {_max} is not set:
                set {_max} to loop-value-2
                set {_index} to loop-index
            else:
                if {_reversed} is not true:
                    if loop-value-2 > {_max}:
                        set {_max} to loop-value-2
                        set {_index} to loop-index
                else:
                    if loop-value-2 < {_max}:
                        set {_max} to loop-value-2
                        set {_index} to loop-index
        set {_var} to {_format}
        replace "[VALUE]" and "[V]" with "%{_max}%" in {_var}
        replace "[INDEX]" and "[I]" with "%loop-number%" in {_var}
        replace "[PLAYER]" and "[P]" with {_indexes::%{_index}%} in {_var}
        add {_var} to {_return::*}
        delete {_indexes::%{_index}%}, {_values::%{_index}%}, {_max} and {_index}
    return {_return::*}

 

musze wpisac komende? /scoreboard objectives add topka ... i co dalej

Glicz

Łączę posty.

Notatka dodana przez Glicz

Odnośnik do komentarza
Udostępnij na innych stronach

  • 0
W dniu 24.10.2021 o 22:06, MrDivo napisał:

[Skript] Reloading kop.sk...

can't understand this event: 'on placeholder request with prefix "topka" (kop.sk, line 7: on placeholder request with prefix "topka":')

[Skript] Encountered 1 error while reloading kop.sk!

Aby zrozumieć co tutaj piszę, wystarczy podstawowy angielski.
Skrypt wymaga dodatku skript-placeholders, dodatkowo powinno być 'on placeholderapi placeholder request for the prefix "topka":'

Odnośnik do komentarza
Udostępnij na innych stronach

  • 0
Godzinę temu, Glicz napisał:

Aby zrozumieć co tutaj piszę, wystarczy podstawowy angielski.
Skrypt wymaga dodatku skript-placeholders, dodatkowo powinno być 'on placeholderapi placeholder request for the prefix "topka":'

Działa! dzięki

a jaką komendę musze wpisać aby było widać ta tabele?

Odnośnik do komentarza
Udostępnij na innych stronach

  • 0
5 godzin temu, MrDivo napisał:

da sie jakos ustawic komende ktory by resetowała wynik na 0?

i czy da sie zrobic reset tej tabeli?

on block break:
    add 1 to {bloki::%player%}

on placeholder request with prefix "topka":
    if the identifier is "bloki":
        set the result to "%createTop(""bloki"", 10, ""&7[INDEX] &6[PLAYER]&7: &e[VALUE]"")%"

command /cleartop:
	trigger:
		clear {bloki::*}

function createTop(name: string, size: integer, format: string="[P] - [V]") :: strings:
    set {_indices::*} to all indices of {%{_name}%::*}
    set {_index} to 1
    if {_size} = 0:
        return ""
    if {_size} < 0:
        set {_reversed} to true
        set {_size} to ({_size} * (-1))
    loop {_indices::*}:
        if {%{_name}%::%loop-value%} = number or timespan or date:
            set {_values::%{_index}%} to {%{_name}%::%loop-value%}
            set {_indexes::%{_index}%} to "%loop-value%"
            add 1 to {_index}
    if {_size} > (size of {_indexes::*}):
        set {_size} to (size of {_indexes::*})
    loop {_size} times:
        loop {_values::*}:
            if {_max} is not set:
                set {_max} to loop-value-2
                set {_index} to loop-index
            else:
                if {_reversed} is not true:
                    if loop-value-2 > {_max}:
                        set {_max} to loop-value-2
                        set {_index} to loop-index
                else:
                    if loop-value-2 < {_max}:
                        set {_max} to loop-value-2
                        set {_index} to loop-index
        set {_var} to {_format}
        replace "[VALUE]" and "[V]" with "%{_max}%" in {_var}
        replace "[INDEX]" and "[I]" with "%loop-number%" in {_var}
        replace "[PLAYER]" and "[P]" with {_indexes::%{_index}%} in {_var}
        add {_var} to {_return::*}
        delete {_indexes::%{_index}%}, {_values::%{_index}%}, {_max} and {_index}
    return {_return::*}

Chodzi ci o coś takiego?

Odnośnik do komentarza
Udostępnij na innych stronach

  • 0
33 minuty temu, Glicz napisał:
on block break:
    add 1 to {bloki::%player%}

on placeholder request with prefix "topka":
    if the identifier is "bloki":
        set the result to "%createTop(""bloki"", 10, ""&7[INDEX] &6[PLAYER]&7: &e[VALUE]"")%"

command /cleartop:
	trigger:
		clear {bloki::*}

function createTop(name: string, size: integer, format: string="[P] - [V]") :: strings:
    set {_indices::*} to all indices of {%{_name}%::*}
    set {_index} to 1
    if {_size} = 0:
        return ""
    if {_size} < 0:
        set {_reversed} to true
        set {_size} to ({_size} * (-1))
    loop {_indices::*}:
        if {%{_name}%::%loop-value%} = number or timespan or date:
            set {_values::%{_index}%} to {%{_name}%::%loop-value%}
            set {_indexes::%{_index}%} to "%loop-value%"
            add 1 to {_index}
    if {_size} > (size of {_indexes::*}):
        set {_size} to (size of {_indexes::*})
    loop {_size} times:
        loop {_values::*}:
            if {_max} is not set:
                set {_max} to loop-value-2
                set {_index} to loop-index
            else:
                if {_reversed} is not true:
                    if loop-value-2 > {_max}:
                        set {_max} to loop-value-2
                        set {_index} to loop-index
                else:
                    if loop-value-2 < {_max}:
                        set {_max} to loop-value-2
                        set {_index} to loop-index
        set {_var} to {_format}
        replace "[VALUE]" and "[V]" with "%{_max}%" in {_var}
        replace "[INDEX]" and "[I]" with "%loop-number%" in {_var}
        replace "[PLAYER]" and "[P]" with {_indexes::%{_index}%} in {_var}
        add {_var} to {_return::*}
        delete {_indexes::%{_index}%}, {_values::%{_index}%}, {_max} and {_index}
    return {_return::*}

Chodzi ci o coś takiego?

Tak, tylko ta 4 linike trzeba było zmienic na to co pisales wczesniej na "on placeholderapi placeholder request for the prefix "topka":"

i wszystko działa ja powinno.

Dzięki bardzo za pomoc! i @hbrt tez :)

Odnośnik do komentarza
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ę...