Skocz do zawartości
  • 0

pomoc do schowku


Wiewior_Pvp

Pytanie

Potrzebuje pomocy do schowku, wszystko dziala zabiera mi rzeczy itp tylko nie do schowka 


 

options:
    kox-max: 2
    refill-max: 12
    pearl-max: 4
    totem-max: 1
    deposit-name: &6&lSchowek
    


    
function getItemInStorage(p: player, i: item, n: integer, v: text, t: text) :: boolean:
    {_p} has {_n} of {_i}:
        send "&cJuz masz &6%{_n}% &c%{_t}%!" to {_p}
        return false
    {storage::%{_v}%::%{_p}%} is less than 1:
        send "&cProbowalem wyplacic kilka %{_t}%, ale masz pusty schowek." to {_p}
        return false
    {_p} doesn't have enough space for 1 of {_i}:
        send "&cProbowalem wyplacic kilka %{_t}%, ale masz pelny ekwipunek." to {_p}
        return false
    loop {_n} times:
        {_p} has {_n} of {_i}:
            exit loop
        {storage::%{_v}%::%{_p}%} is less than 1:
            exit loop
        {_p} doesn't have enough space for {_i}:
            exit loop
        add {_i} to {_p}
        remove 1 from {storage::%{_v}%::%{_p}%}
        add 1 to {_num}
    {_num} is not set:
        return false
    send "&aWyplacono &6%{_num}% &a%{_t}%!" to {_p}
    return true
    
every 1 second:
    set {_i::*} to enchanted golden apple, golden apple, ender pearl and totem of undying
    set {_n::*} to {@kox-max}, {@refill-max}, {@pearl-max} and {@totem-max}
    set {_v::*} to "kox", "refill", "pearl", "totem" and "chorus"
    set {_t::*} to "koxów", "refilli", "pereł", "totemów" and "chorusów"
    loop all players:
        loop {_i::*}:
            loop-player has ({_n::%loop-index%} + 1) of loop-value-2
            add ((amount of loop-value-2 in loop-player's inventory) - {_n::%loop-index%}) to {storage::%{_v::%loop-index%}%::%loop-player%}
            remove ((amount of loop-value-2 in loop-player's inventory) - {_n::%loop-index%}) of loop-value-2 from loop-player's inventory
            send "&cMiales za duzo %{_t::%loop-index%}%, przeniesiono nadmiar do depozytu!" to loop-player

command /schowek [<text>]:
    aliases: depozyt
    trigger:
        open chest with 5 rows named "&8&lSchowek" to player
        set slot (integers between 0 and 55) of player's current inventory to black stained glass pane named " " with lore "&8&o" 
        set player's current inventory's slot 15 to ender pearl named "&9Perelki" with lore "&8&m---&r&8» &ePosiadasz: &f&l%{perla::%player%}% &8«&8&m---&r" and " " and "&8&m---&r&8» &fLimit w eq: {@pearl-max} &8«&8&m---&r "
        set player's current inventory's slot 11 to enchanted golden apple named "&6Koxy" with lore "&8&m---&r&8» &ePosiadasz: &f&l%{kox::%player%}% &8«&8&m---&r" and " " and "&8&m---&r&8» &fLimit w eq: {@kox-max} &8«&8&m---&r "
        set player's current inventory's slot 30 to totem of undying named "&fTotem" with lore "&8&m---&r&8» &ePosiadasz: &f&l%{totem::%player%}% &8«&8&m---&r" and " " and "&8&m---&r&8» &fLimit w eq: {@totem-max} &8«&8&m---&r "
        set player's current inventory's slot 13 to golden apple named "&eRefile" with lore "&8&m---&r&8» &ePosiadasz: &f&l%{ref::%player%}% &8«&8&m---&r" and " " and "&8&m---&r&8» &fLimit w eq: {@refill-max} &8«&8&m---&r "
        set player's current inventory's slot 32 to nether star named "&aDobierz wszystko" with lore "&7» Nacisnij aby sie dobrac!" 
        
on inventory click:
    event-inventory is not player's inventory
    if name of event-inventory is "&8&lSchowek":
        cancel event
        if clicked slot is 15:
            if {perla::%player%} is not 0:    
                set {_i} to number of ender pearl in player's inventory
                if {_i} is not {@pearl-max}: 
                    set {_wyplacperly} to {@pearl-max} - {_i}
                    if {_wyplacperly} is set:
                        if {_wyplacperly} is less than or equal to {perla::%player%}:
                            give {_wyplacperly} of ender pearl to player
                            remove {_wyplacperly} from {perla::%player%}
                        else:
                            give {perla::%player%} of ender pearl to player
                            set {perla::%player%} to 0
        if clicked slot is 11:
            if {kox::%player%} is not 0:
                set {_i} to number of enchanted golden apple in player's inventory
                if {_ilosckoxoprzysobie} is not {@kox-max}:
                    set {_wyplackoxy} to {@kox-max} - {_ilosckoxoprzysobie}
                    if {_wyplackoxy} is set:
                        if {_wyplackoxy} is less than or equal to {kox::%player%}:
                            give {_wyplackoxy} of enchanted golden apple to player
                            remove {_wyplackoxy} from {kox::%player%}
                        else:
                            give {kox::%player%} of enchanted golden apple to player
                            set {kox::%player%} to 0
        if clicked slot is 30:
            if {totem::%player%} is not 0:    
                set {_iloscwedekprzysobie} to number of totem of undying in player's inventory
                if {_iloscwedekprzysobie} is not {@totem-max}:    
                    set {_wyplacwedka} to {@totem-max} - {_iloscwedekprzysobie}
                    if {_wyplacwedka} is set:
                        if {_wyplacwedka} is less than or equal to {totem::%player%}:
                            give {_wyplacwedka} of totem of undying to player
                            remove {_wyplacwedka} from {totem::%player%}
                        else:
                            give {totem::%player%} of totem of undying to player
                            set {totem::%player%} to 0
        if clicked slot is 13:
            if {ref::%player%} is not 0:
                set {_iloscrefiliprzysobie} to number of golden apple in player's inventory
                if {_iloscrefiliprzysobie} is not {@refill-max}:
                    set {_wyplacrefy} to {@refill-max} - {_iloscrefiliprzysobie}
                    if {_wyplacrefy} is set:
                        if {_wyplacrefy} is less than or equal to {ref::%player%}:
                            give {_wyplacrefy} of golden apple to player
                            remove {_wyplacrefy} from {ref::%player%}
                        else:
                            give {ref::%player%} of golden apple to player
                            set {ref::%player%} to 0
        if clicked slot is 32:
            if {perla::%player%} is not 0:    
                set {_iloscperelprzysobie} to number of ender pearl in player's inventory
                if {_iloscperelprzysobie} is not {@pearl-max}: 
                    set {_wyplacperly} to {@pearl-max} - {_iloscperelprzysobie}
                    if {_wyplacperly} is set:
                        if {_wyplacperly} is less than or equal to {perla::%player%}:
                            give {_wyplacperly} of ender pearl to player
                            remove {_wyplacperly} from {perla::%player%}
                        else:
                            give {perla::%player%} of ender pearl to player
                            set {perla::%player%} to 0
            if {kox::%player%} is not 0:
                set {_ilosckoxoprzysobie} to number of enchanted golden apple in player's inventory
                if {_ilosckoxoprzysobie} is not {@kox-max}:
                    set {_wyplackoxy} to {@kox-max} - {_ilosckoxoprzysobie}
                    if {_wyplackoxy} is set:
                        if {_wyplackoxy} is less than or equal to {kox::%player%}:
                            give {_wyplackoxy} of enchanted golden apple to player
                            remove {_wyplackoxy} from {kox::%player%}
                        else:
                            give {kox::%player%} of enchanted golden apple to player
                            set {kox::%player%} to 0
            if {ref::%player%} is not 0:
                set {_iloscrefiliprzysobie} to number of golden apple in player's inventory
                if {_iloscrefiliprzysobie} is not {@refill-max}:
                    set {_wyplacrefy} to {@refill-max} - {_iloscrefiliprzysobie}
                    if {_wyplacrefy} is set:
                        if {_wyplacrefy} is less than or equal to {ref::%player%}:
                            give {_wyplacrefy} of golden apple to player
                            remove {_wyplacrefy} from {ref::%player%}
                        else:
                            give {ref::%player%} of golden apple to player
                            set {ref::%player%} to 0
            if {totem::%player%} is not 0:    
                set {_iloscwedekprzysobie} to number of totem of undying in player's inventory
                if {_iloscwedekprzysobie} is not {@totem-max}:    
                    set {_wyplacwedka} to {@totem-max} - {_iloscwedekprzysobie}
                    if {_wyplacwedka} is set:
                        if {_wyplacwedka} is less than or equal to {totem::%player%}:
                            give {_wyplacwedka} of totem of undying to player
                            remove {_wyplacwedka} from {totem::%player%}
                        else:
                            give {totem::%player%} of totem of undying to player
                            set {totem::%player%} to 0

 

Edytowane przez Wiewior_Pvp
Odnośnik do komentarza
https://skript.pl/temat/49399-pomoc-do-schowku/
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ę...