Skocz do zawartości
  • 0

banknot


the_kakus

Pytanie

mam problem gdyz banknoty nie chcą sie wplacac

command /withdraw [<integer>]:
    aliases: wyplac
    trigger:
        if arg 1 is not set:
            send "&4Błąd: &c/withdraw <kwota>"
        else:
            if arg 1 > {money.%player%}:
                send "&4Błąd: &cNie masz tylu pieniędzy!"
            else:
                send "&8» &aWypłaciłeś banknot o wartości &b%arg 1%&7PLN&a"
                remove arg 1 from {money.%player%}
                give paper named "&6Banknot" with lore "&fWartość: &2%arg 1%&7PLN" to player

on right click:
    player's tool's type is paper
    player's tool's name is "&6Banknot"
    player's tool's lore contains "&7Wartość: &2"
    set {_banknot} to (substring of (line 1 of player's tool's lore) from characters 14 to (length of (line 1 of player's tool's lore) - 5)) parsed as integer
    add {_banknot} to {money.%player%}
    set player's tool to (item amount of player's tool - 1) of player's tool
    send "&8» &aWpłaciłeś &b%{_banknot}%&7PLN &ana swoje konto!"

 

Glicz

Wstawiam kod w code.

Notatka dodana przez Glicz

Odnośnik do komentarza
https://skript.pl/temat/46350-banknot/
Udostępnij na innych stronach

9 odpowiedzi na to pytanie

Rekomendowane odpowiedzi

  • 0


player's tool's lore contains "&7Wartość: &2"

czy tą

 set {_banknot} to (substring of (line 1 of player's tool's lore) from characters 14 to (length of (line 1 of player's tool's lore) - 5)) parsed as integer

Glicz

Poprawiam formatowanie na ciemnym motywie

Notatka dodana przez Glicz

Odnośnik do komentarza
https://skript.pl/temat/46350-banknot/#findComment-291737
Udostępnij na innych stronach

  • 0
11 godzin temu, the_kakus napisał:


player's tool's lore contains "&7Wartość: &2"

czy tą

 set {_banknot} to (substring of (line 1 of player's tool's lore) from characters 14 to (length of (line 1 of player's tool's lore) - 5)) parsed as integer

Tą z 'player's tool's lore contains'.

Glicz

Poprawiam cytat

Notatka dodana przez Glicz

Odnośnik do komentarza
https://skript.pl/temat/46350-banknot/#findComment-291738
Udostępnij na innych stronach

  • 0
7 minut temu, the_kakus napisał:

dalej nie dziala, nawet wiadomosc o wplacaniu banknotu sie nie wyswietla

Zobacz w takim razie co zwraca ten substring.

Zamień linijkę z substring na to:

set {_banknot} to (substring of (line 1 of player's tool's lore) from characters 14 to (length of (line 1 of player's tool's lore) - 5))
send {_banknot} to player

 

Odnośnik do komentarza
https://skript.pl/temat/46350-banknot/#findComment-291742
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ę...