Skocz do zawartości
  • 0

Czy ktoś może pomóc mi z tym skryptem?


Pytanie

Czy ktoś mógłby naprawić i pomóc mi z tym kodem? Nawet chatgpt nie może sobie z nim uporać! Cały czas wyskakują błędy...!

options:
    cashvalue: 0.5, 1, 5
    cashchance: 5, 3, 1

# Event niszczenia bloków
on break of stone, dirt, cobblestone, granite, diorite, andesite, netherrack, sand, gravel, deepslate, tuff, basalt, coal ore, iron ore, gold ore, diamond ore, emerald ore, redstone ore, lapis ore, quartz ore, deepslate coal ore, deepslate iron ore, deepslate gold ore, deepslate diamond ore, deepslate emerald ore, deepslate redstone ore, deepslate lapis ore, deepslate copper ore, copper ore:
    set {_value} to random element out of {cashvalue}
    set {_chance} to random element out of {cashchance}
    chance of {_chance}%:
        add {_value} to {cash::%player's uuid%}
        send title "&f&lTry Inu" with subtitle "&c&lWydropiłeś %{_value}% Try Inu!" for 4 seconds to player
        send action bar "&f&lSprawdź ilość wykopanego Try Inu pod /kasa" to player
        play sound "block.note_block.pling" to player
        call function update_player_scoreboard(player)

# Komenda /kasa
command /kasa:
    trigger:
        send "Twój stan konta to: %{cash::%player's uuid%}% zł" to player

# Komenda /wyplac
command /wyplac:
    trigger:
        set {_gui} to chest inventory with 3 rows named "Wypłata"
        if {cash::%player's uuid%} is greater than or equal to 500:
            set {_nick} to player's name
            set {_tryinu} to "%{cash::%player's uuid%}%"
            set {_code} to "%{_nick}%" + "_" + "%{_tryinu}%"
            set {_chars} to "TRY"
            set {_shuffled} to ""
            loop {_code}:
                add loop-value to {_shuffled}
                if random integer between 0 and 1 is 0:
                    add random element out of {_chars} to {_shuffled}
            set {_beacon} to a beacon named "&aAby wypłacić przekaż ten szyfr adminowi:" with lore "&b%{_shuffled}%"
            set slot 13 of {_gui} to {_beacon}
        else:
            set slot 13 of {_gui} to a bedrock named "&cWymagany minimum wypłaty to 500 Try Inu!"
        open {_gui} to player

# Obsługa kliknięć w GUI /wyplac
on inventory click:
    if name of event-inventory is "Wypłata":
        cancel event
        if event-inventory is not player's inventory:
            if clicked slot is 13:
                if {cash::%player's uuid%} is greater than or equal to 500:
                    send "Przekaż szyfr adminowi, aby dokonać wypłaty!" to player
                else:
                    send "Nie masz wystarczająco dużo Try Inu do wypłaty!" to player

# Funkcja aktualizacji scoreboard
function update_player_scoreboard(p: player):
    set {_balance} to {cash::%p's uuid%}
    set {_rank} to "Brak" # Domyślna ranga, zmień jeśli chcesz inną domyślną wartość
    if player has permission "powerranks.rank":
        set {_rank} to "%{prefix of player}%"

    set {_withdrawal_status} to "Nie"
    if {_balance} >= 500:
        set {_withdrawal_status} to "Tak"

    set {_player} to display name of p
    set sidebar score for {_player} to 5
    set sidebar score for "Kasa: %{_balance}% Try Inu" to 4
    set sidebar score for "Możliwość wypłaty: %{_withdrawal_status}%" to 3
    set sidebar score for "Ranga: %{_rank}%" to 2
    set sidebar score for " " to 1

# Aktualizacja scoreboard przy dołączeniu
on join:
    call function update_player_scoreboard(player)

# Aktualizacja scoreboard co minutę
every 1 minute:
    loop all players:
        call function update_player_scoreboard(loop-player)

 

Odnośnik do komentarza
https://skript.pl/temat/57765-czy-kto%C5%9B-mo%C5%BCe-pom%C3%B3c-mi-z-tym-skryptem/
Udostępnij na innych stronach

4 odpowiedzi na to pytanie

Rekomendowane odpowiedzi

  • 0
7 minut temu, szymonYT napisał:

Czy ktoś mógłby naprawić i pomóc mi z tym kodem? Nawet chatgpt nie może sobie z nim uporać! Cały czas wyskakują błędy...!

Proszę opisać w jaki sposób ma działać skrypt i podać listę błędów podanych przez Skript. Bez tych informacji Pan najprawdopodobniej nie doczeka się pomocy, gdyż będzie to niezwykle trudne.

Pozdrawiam.

Odnośnik do komentarza
https://skript.pl/temat/57765-czy-kto%C5%9B-mo%C5%BCe-pom%C3%B3c-mi-z-tym-skryptem/#findComment-343376
Udostępnij na innych stronach

  • 0
11 minut temu, Kormic napisał:

Proszę opisać w jaki sposób ma działać skrypt i podać listę błędów podanych przez Skript. Bez tych informacji Pan najprawdopodobniej nie doczeka się pomocy, gdyż będzie to niezwykle trudne.

Pozdrawiam.

[19:13:58] [Server thread/INFO]: [Skript] Line 6: (try_inu.sk)
[19:13:58] [Server thread/INFO]:     List is missing 'and' or 'or', defaulting to 'and': stone, dirt, cobblestone, granite, diorite, andesite, netherrack, sand, gravel, deepslate, tuff, basalt, coal ore, iron ore, gold ore, diamond ore, emerald ore, redstone ore, lapis ore, quartz ore, deepslate coal ore, deepslate iron ore, deepslate gold ore, deepslate diamond ore, deepslate emerald ore, deepslate redstone ore, deepslate lapis ore, deepslate copper ore, copper ore
[19:13:58] [Server thread/INFO]:     Line: on break of stone, dirt, cobblestone, granite, diorite, andesite, netherrack, sand, gravel, deepslate, tuff, basalt, coal ore, iron ore, gold ore, diamond ore, emerald ore, redstone ore, lapis ore, quartz ore, deepslate coal ore, deepslate iron ore, deepslate gold ore, deepslate diamond ore, deepslate emerald ore, deepslate redstone ore, deepslate lapis ore, deepslate copper ore, copper ore:
[19:13:58] [Server thread/INFO]:  
[19:13:59] [Server thread/INFO]: [Skript] Line 55: (try_inu.sk)
[19:13:59] [Server thread/INFO]:     There's no player in a function event
[19:13:59] [Server thread/INFO]:     Line: if player has permission "powerranks.rank":
[19:13:59] [Server thread/INFO]:  
[19:13:59] [Server thread/INFO]: [Skript] Line 62: (try_inu.sk)
[19:13:59] [Server thread/INFO]:     Can't understand this expression: 'display name of p'
[19:13:59] [Server thread/INFO]:     Line: set {_player} to display name of p
[19:13:59] [Server thread/INFO]:  
[19:13:59] [Server thread/INFO]: [Skript] Line 63: (try_inu.sk)
[19:13:59] [Server thread/INFO]:     Can't understand this condition/effect: set sidebar score for {_player} to 5
[19:13:59] [Server thread/INFO]:     Line: set sidebar score for {_player} to 5
[19:13:59] [Server thread/INFO]:  
[19:13:59] [Server thread/INFO]: [Skript] Line 64: (try_inu.sk)
[19:13:59] [Server thread/INFO]:     Can't understand this condition/effect: set sidebar score for "Kasa: %{_balance}% Try Inu" to 4
[19:13:59] [Server thread/INFO]:     Line: set sidebar score for "Kasa: %{_balance}% Try Inu" to 4
[19:13:59] [Server thread/INFO]:  
[19:13:59] [Server thread/INFO]: [Skript] Line 65: (try_inu.sk)
[19:13:59] [Server thread/INFO]:     Can't understand this condition/effect: set sidebar score for "Możliwość wypłaty: %{_withdrawal_status}%" to 3
[19:13:59] [Server thread/INFO]:     Line: set sidebar score for "Możliwość wypłaty: %{_withdrawal_status}%" to 3
[19:13:59] [Server thread/INFO]:  
[19:13:59] [Server thread/INFO]: [Skript] Line 66: (try_inu.sk)
[19:13:59] [Server thread/INFO]:     Can't understand this condition/effect: set sidebar score for "Ranga: %{_rank}%" to 2
[19:13:59] [Server thread/INFO]:     Line: set sidebar score for "Ranga: %{_rank}%" to 2
[19:13:59] [Server thread/INFO]:  
[19:13:59] [Server thread/INFO]: [Skript] Line 67: (try_inu.sk)
[19:13:59] [Server thread/INFO]:     Can't understand this condition/effect: set sidebar score for " " to 1
[19:13:59] [Server thread/INFO]:     Line: set sidebar score for " " to 1
[19:13:59] [Server thread/INFO]:  
[19:13:59] [Server thread/INFO]: [Skript] Line 31: (try_inu.sk)
[19:13:59] [Server thread/INFO]:     Can't loop '{_code}' because it's only a single value
[19:13:59] [Server thread/INFO]:     Line: loop {_code}:
[19:13:59] [Server thread/INFO]:  
[19:13:59] [Server thread/INFO]: [Skript] Line 11: (try_inu.sk)
[19:13:59] [Server thread/INFO]:     Can't understand this condition/effect: send title "&f&lTry Inu" with subtitle "&c&lWydropiłeś %{_value}% Try Inu!" for 4 seconds to player
[19:14:00] [Server thread/INFO]:     Line: send title "&f&lTry Inu" with subtitle "&c&lWydropiłeś %{_value}% Try Inu!" for 4 seconds to player
[19:14:00] [Server thread/INFO]:  
[19:14:00] [Server thread/INFO]: [Skript] Line 14: (try_inu.sk)
[19:14:00] [Server thread/INFO]:     Can't understand this condition/effect: call function update_player_scoreboard(player)
[19:14:00] [Server thread/INFO]:     Line: call function update_player_scoreboard(player)
[19:14:00] [Server thread/INFO]:  
[19:14:00] [Server thread/INFO]: [Skript] Line 71: (try_inu.sk)
[19:14:00] [Server thread/INFO]:     Can't understand this condition/effect: call function update_player_scoreboard(player)
[19:14:00] [Server thread/INFO]:     Line: call function update_player_scoreboard(player)
[19:14:00] [Server thread/INFO]:  
[19:14:00] [Server thread/INFO]: [Skript] Line 76: (try_inu.sk)
[19:14:00] [Server thread/INFO]:     Can't understand this condition/effect: call function update_player_scoreboard(loop-player)
[19:14:00] [Server thread/INFO]:     Line: call function update_player_scoreboard(loop-player)
[19:14:00] [Server thread/INFO]:  


Takie błędy mi wyskakują, chciałbym aby skrypt działał o tak:

co wykopany blok jest szansa na trafienie monety Try Inu i dodanie danej ilości do konta gracza oraz pokazanie wiadomości, pod /kasa można zobaczyć stan konta oraz pod /wyplac zobaczyć informację na temat wypłat, chciałbym również uwzględnić scoreboard
Odnośnik do komentarza
https://skript.pl/temat/57765-czy-kto%C5%9B-mo%C5%BCe-pom%C3%B3c-mi-z-tym-skryptem/#findComment-343377
Udostępnij na innych stronach

  • 0

ChatGPT to może jedynie mi berło czyścić, bo on kompletnie na skryptach się nie zna.

Zauważyłem, że na początku bierzesz null do szans zamiast z opcji. I masz powalone taby. I jeżeli to pisał ChatGPT to on lepiej niech skryptów nie pisze

Odnośnik do komentarza
https://skript.pl/temat/57765-czy-kto%C5%9B-mo%C5%BCe-pom%C3%B3c-mi-z-tym-skryptem/#findComment-343399
Udostępnij na innych stronach

  • 0

CZęść rzeczy poprawiłem jednak nie posiadam na serwerze testowym addona który potrafi tworzyć scoreboard oraz nie rozumiem tego twojego tworzenia szyfru dla adnima nie wiem jak ma to działać...
 

 

Odnośnik do komentarza
https://skript.pl/temat/57765-czy-kto%C5%9B-mo%C5%BCe-pom%C3%B3c-mi-z-tym-skryptem/#findComment-343451
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.

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

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