Skocz do zawartości
  • 0

Parkour Script


DevDavEd_zQ

Pytanie

Witam mam problem z tym skryptem bo chce zrobic parkour z timerem, placeholderami ale nie dziala mi skrypt co mam:
 

options:
  tick-ms: 50
 
# ------------------------
# TIMER START
# ------------------------
 
on step on gold block:
    if world of player is "lobby":
        if {timer.running.%uuid of player%} is not set:
            set {timer.ms.%uuid of player%} to 0
            set {timer.running.%uuid of player%} to true
            send action bar "&aCzas: &f0h 0m 0s 0ms" to player
            send "&8>> &aAby zatrzymać czas, napisz &2/parkourstop&a!" to player
        else:
            send "&cJuż masz włączony timer!" to player
 
# ------------------------
# TIMER STOP I RANKING
# ------------------------
 
on step on oak pressure plate:
    if world of player is "lobby":
        if {timer.running.%uuid of player%} is true:
            set {_time} to {timer.ms.%uuid of player%}
 
            # konwersja milisekund
            set {_hours} to floor({_time} / 3600000)
            set {_time} to {_time} - ({_hours} * 3600000)
            set {_minutes} to floor({_time} / 60000)
            set {_time} to {_time} - ({_minutes} * 60000)
            set {_seconds} to floor({_time} / 1000)
            set {_millis} to {_time} - ({_seconds} * 1000)
 
            # aktualizacja najlepszego czasu
            if {parkour.besttime.%uuid of player%} is not set:
                set {parkour.besttime.%uuid of player%} to {timer.ms.%uuid of player%}
            else if {timer.ms.%uuid of player%} < {parkour.besttime.%uuid of player%}:
                set {parkour.besttime.%uuid of player%} to {timer.ms.%uuid of player%}
 
            # tworzenie rankingu z nazwami graczy
            clear {parkour.ranking::*}
            loop {parkour.besttime::*}:
                add "%loop-index%;%loop-value%;%loop-player%" to {parkour.ranking::*}
 
            # sortowanie po czasie
            set {_temp::*} to {parkour.besttime::*}
            clear {parkour.sorted::*}
            while {_temp::*} is set:
                set {_bestUUID} to first element out of {_temp::*}
                set {_bestTime} to {_temp::%{_bestUUID}%}
                loop {_temp::*}:
                    if {_temp::%loop-index%} < {_bestTime}:
                        set {_bestUUID} to loop-index
                        set {_bestTime} to {_temp::%loop-index%}
                add "%{_bestUUID}%;%{_bestTime}%;%player of {_bestUUID}%" to {parkour.sorted::*}
                delete {_temp::%{_bestUUID}%}
            set {parkour.ranking::*} to {parkour.sorted::*}
 
            execute console command "lobby %player%"
            send "&8>> &aPrzeszedłeś parkour w &2%{_hours}%h %{_minutes}%m %{_seconds}%s %{_millis}%ms&a!" to player
            delete {timer.running.%uuid of player%}
            delete {timer.ms.%uuid of player%}
            send action bar " " to player
 
# ------------------------
# CZYSZCZENIE
# ------------------------
 
on world change:
    delete {timer.running.%uuid of player%}
    delete {timer.ms.%uuid of player%}
    send action bar " " to player
 
on quit:
    delete {timer.running.%uuid of player%}
    delete {timer.ms.%uuid of player%}
 
# ------------------------
# KOMENDA STOP
# ------------------------
 
command /parkourstop:
    trigger:
        if {timer.running.%uuid of player%} is true:
            delete {timer.running.%uuid of player%}
            delete {timer.ms.%uuid of player%}
            send "&aTimer został zatrzymany." to player
            send action bar " " to player
        else:
            send "&cNie masz włączonego timera." to player
 
# ------------------------
# TIMER UPDATE
# ------------------------
 
every 1 tick:
    loop all players:
        if {timer.running.%uuid of loop-player%} is true:
            if world of loop-player is "lobby":
                add {@tick-ms} to {timer.ms.%uuid of loop-player%}
                set {_time} to {timer.ms.%uuid of loop-player%}
                set {_hours} to floor({_time} / 3600000)
                set {_time} to {_time} - ({_hours} * 3600000)
                set {_minutes} to floor({_time} / 60000)
                set {_time} to {_time} - ({_minutes} * 60000)
                set {_seconds} to floor({_time} / 1000)
                set {_millis} to {_time} - ({_seconds} * 1000)
                send action bar "&aCzas: &f%{_hours}%h %{_minutes}%m %{_seconds}%s %{_millis}%ms" to loop-player
 
# ------------------------
# PLACEHOLDERAPI
# ------------------------
 
placeholderapi placeholder with the prefix "parkourrankingtop":
    set {_arg} to placeholder identifier
    if {_arg} is not set:
        set result to "&7Błędny numer pozycji"
        stop
 
    set {_index} to {_arg} parsed as number
    if {_index} <= 0:
        set result to "&7Błędny numer pozycji"
        stop
 
    if {parkour.ranking::%{_index}%} is not set:
        set result to "&7Brak gracza"
        stop
 
    set {_line} to {parkour.ranking::%{_index}%}
    set {_playername} to third element of split {_line} at ";"
    set {_time} to second element of split {_line} at ";"
 
    set {_ms_total} to {_time}
    set {_hours} to floor({_ms_total} / 3600000)
    set {_ms_total} to {_ms_total} - ({_hours} * 3600000)
    set {_minutes} to floor({_ms_total} / 60000)
    set {_ms_total} to {_ms_total} - ({_minutes} * 60000)
    set {_seconds} to floor({_ms_total} / 1000)
    set {_millis} to {_ms_total} - ({_seconds} * 1000)
 
    set result to "&f%{_index}%. &7%{_playername}% &f%{_hours}%h %{_minutes}%m %{_seconds}%s %{_millis}%ms"


bledy sa takie: ( mam skquery i skutilites i sk-placeholders )

[13:46:12] [INFO]: Line 44: (parkour.sk)
[13:46:12] [INFO]:     There's no loop that matches 'loop-player'
[13:46:12] [INFO]:     Line: add "%loop-index%;%loop-value%;%loop-player%" to {parkour.ranking::*}
[13:46:12] [INFO]:  
[13:46:12] [INFO]: Line 56: (parkour.sk)
[13:46:12] [INFO]:     Can't understand this expression: player of {_bestUUID}
[13:46:12] [INFO]:     Line: add "%{_bestUUID}%;%{_bestTime}%;%player of {_bestUUID}%" to {parkour.sorted::*}
[13:46:12] [INFO]:  
[13:46:12] [INFO]: Line 131: (parkour.sk)
[13:46:12] [INFO]:     Can't understand this expression: 'third element of split {_line} at ";"'
[13:46:12] [INFO]:     Line: set {_playername} to third element of split {_line} at ";"
[13:46:12] [INFO]:  
[13:46:12] [INFO]: Line 132: (parkour.sk)
[13:46:12] [INFO]:     Can't understand this expression: 'second element of split {_line} at ";"'
[13:46:12] [INFO]:     Line: set {_time} to second element of split {_line} at ";"
[13:46:12] [INFO]:  
Edytowane przez DevDavEd_zQ
zmienilem skrypt troche
Odnośnik do komentarza
https://skript.pl/temat/58921-parkour-script/
Udostępnij na innych stronach

0 odpowiedzi na to pytanie

Rekomendowane odpowiedzi

Nie udzielono jeszcze odpowiedzi na to pytanie

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.

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

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