Skocz do zawartości
  • 0

Rozdawanie skrzynek


gnomq

Pytanie

14 odpowiedzi na to pytanie

Rekomendowane odpowiedzi

  • 0
command /dodajskrsynke [<text>]:
    permission: *
    trigger:
        loop all players:
            add chest named "&6premiumchest" to {chest::%loop-player%::*}
            send "dodano skrzynkę do schowka" to loop-player
command /odbierz [<text>]:
    trigger:
        add {chest::%player%::*} to player
        clear {chest::%player%::*}
        Send "odebrano" 

 

Odnośnik do komentarza
https://skript.pl/temat/37436-rozdawanie-skrzynek/#findComment-238131
Udostępnij na innych stronach

  • 0
variables:
	{skrzynka::%player%} = 0

function bReturnItem(p: player) :: boolean:
    if {skrzynka::%{_p}%} is 0:
        return false
        stop
    return true
    stop

function bReturnName(p: player) :: text:
    if bReturnItem({_p}) is false:
        return "Nie masz zadnych skrzynek do odbioru!"
        stop
    return "Masz do odbioru: %{skrzynka::%{_p}%}% skrzynek"
    stop
    

command /skrzynkadaj [<number>]:
    permission: default.op
    permission message: Nie ma takiej komendy!
    trigger:
        if arg 1 is not set:
            send "/skrzynkadaj <ilosc>"
            stop
        loop all players:
            add arg 1 to {skrzynka::%loop-player%}
            send "Administator &c%player% &frozdal &a%arg 1% &fskrzynek dla wszystkich!" to all players
            stop

command /odbierzskrzynke [<text>]:
    trigger:
        open chest with 1 row named "Odbierz skrzynke!" to player
        set {_ilosc} to {skrzynka::%player%}
        if bReturnItem(player) is true:
            set player's current inventory's slot 4 to {_ilosc} of chest named "%bReturnName(player)%"
            stop
        if bReturnItem(player) is false:
            set player's current inventory's slot 4 to barrier named "%bReturnName(player)%"
            stop

on inventory click:
    set {_player} to event.getWhoClicked()
    if event.getInventory().getTitle() is "Odbierz skrzynke!":
        cancel event
        if event.getSlot() is 4:
            if event.getCurrentItem() is chest:
                close {_player}'s inventory
                give {skrzynka::%{_player}%} of chest to {_player}
                set {skrzynka::%{_player}%} to 0
                send "Poprawnie odebrales swoje skrzynki!" to {_player}

Skript min. 2.2
Skript-mirror

Odnośnik do komentarza
https://skript.pl/temat/37436-rozdawanie-skrzynek/#findComment-238139
Udostępnij na innych stronach

  • 0
5 godzin temu, LjayPL789 napisał:

variables:
	{skrzynka::%player%} = 0

function bReturnItem(p: player) :: boolean:
    if {skrzynka::%{_p}%} is 0:
        return false
        stop
    return true
    stop

function bReturnName(p: player) :: text:
    if bReturnItem({_p}) is false:
        return "Nie masz zadnych skrzynek do odbioru!"
        stop
    return "Masz do odbioru: %{skrzynka::%{_p}%}% skrzynek"
    stop
    

command /skrzynkadaj [<number>]:
    permission: default.op
    permission message: Nie ma takiej komendy!
    trigger:
        if arg 1 is not set:
            send "/skrzynkadaj <ilosc>"
            stop
        loop all players:
            add arg 1 to {skrzynka::%loop-player%}
            send "Administator &c%player% &frozdal &a%arg 1% &fskrzynek dla wszystkich!" to all players
            stop

command /odbierzskrzynke [<text>]:
    trigger:
        open chest with 1 row named "Odbierz skrzynke!" to player
        set {_ilosc} to {skrzynka::%player%}
        if bReturnItem(player) is true:
            set player's current inventory's slot 4 to {_ilosc} of chest named "%bReturnName(player)%"
            stop
        if bReturnItem(player) is false:
            set player's current inventory's slot 4 to barrier named "%bReturnName(player)%"
            stop

on inventory click:
    set {_player} to event.getWhoClicked()
    if event.getInventory().getTitle() is "Odbierz skrzynke!":
        cancel event
        if event.getSlot() is 4:
            if event.getCurrentItem() is chest:
                close {_player}'s inventory
                give {skrzynka::%{_player}%} of chest to {_player}
                set {skrzynka::%{_player}%} to 0
                send "Poprawnie odebrales swoje skrzynki!" to {_player}

Skript min. 2.2
Skript-mirror

Nie ma błędów, ale w GUI nie mam skrzynki

Odnośnik do komentarza
https://skript.pl/temat/37436-rozdawanie-skrzynek/#findComment-238184
Udostępnij na innych stronach

  • 0
8 godzin temu, LjayPL789 napisał:

Dziwne, nawet bardzo dziwne - ja testowałem i wszystko śmigało 🤔
Sprawdź, co zwraca zmienna {skrzynka::%player%}.


 
[17:28:25] [Server thread/WARN]: [Skript] No matching method: CraftInventoryCrafting#getTitle called without arguments
[17:28:29] [Server thread/WARN]: [Skript] No matching method: CraftInventoryCrafting#getTitle called without arguments
[17:28:37] [Server thread/WARN]: [Skript] No matching method: CraftInventory#getTitle called without arguments
[17:28:37] [Server thread/WARN]: [Skript] No matching method: CraftInventory#getTitle called without arguments
[17:28:38] [Server thread/WARN]: [Skript] No matching method: CraftInventory#getTitle called without arguments
[17:28:40] [Server thread/WARN]: [Skript] No matching method: CraftInventoryCrafting#getTitle called without arguments
[17:28:41] [Server thread/WARN]: [Skript] No matching method: CraftInventoryCrafting#getTitle called without arguments
[17:28:41] [Server thread/WARN]: [Skript] No matching method: CraftInventoryCrafting#getTitle called without arguments
[17:28:42] [Server thread/WARN]: [Skript] No matching method: CraftInventoryCrafting#getTitle called without arguments
[17:28:45] [Server thread/WARN]: [Skript] No matching method: CraftInventoryDoubleChest#getTitle called without arguments
[17:28:45] [Server thread/WARN]: [Skript] No matching method: CraftInventoryDoubleChest#getTitle called without arguments
[17:28:49] [Server thread/WARN]: [Skript] No matching method: CraftInventory#getTitle called without arguments
[17:28:49] [Server thread/WARN]: [Skript] No matching method: CraftInventory#getTitle called without arguments
[17:28:51] [Server thread/WARN]: [Skript] No matching method: CraftInventoryDoubleChest#getTitle called without arguments

 

Edytowane przez HeezQ
HeezQ

Wstawiam w code

Notatka dodana przez HeezQ

Odnośnik do komentarza
https://skript.pl/temat/37436-rozdawanie-skrzynek/#findComment-238186
Udostępnij na innych stronach

  • 0
on inventory click:
    if inventory name of current inventory of player is "Odbierz skrzynke!":
        cancel event
        if clicked slot is 4:
            if clicked item is chest:
                close player's inventory
                give {skrzynka::%player%} of chest to player
                set {skrzynka::%player%} to 0
                send "Poprawnie odebrales swoje skrzynki!" to player

Jak javowo nie działa, to skriptowo zadziała :kappaseems:

Odnośnik do komentarza
https://skript.pl/temat/37436-rozdawanie-skrzynek/#findComment-238187
Udostępnij na innych stronach

  • 0
3 minuty temu, LjayPL789 napisał:

on inventory click:
    if inventory name of current inventory of player is "Odbierz skrzynke!":
        cancel event
        if clicked slot is 4:
            if clicked item is chest:
                close player's inventory
                give {skrzynka::%player%} of chest to player
                set {skrzynka::%player%} to 0
                send "Poprawnie odebrales swoje skrzynki!" to player

Jak javowo nie działa, to skriptowo zadziała :kappaseems:

Haha, ale to samo się dzieje i puste sloty :O

Odnośnik do komentarza
https://skript.pl/temat/37436-rozdawanie-skrzynek/#findComment-238188
Udostępnij na innych stronach

  • 0
[17:42:14] [Server thread/WARN]: [Skript] No matching method: CraftInventoryCrafting#getTitle called without arguments

 

Edytowane przez HeezQ
HeezQ

Usuwam formatowanie; wstawiam w code

Notatka dodana przez HeezQ

Odnośnik do komentarza
https://skript.pl/temat/37436-rozdawanie-skrzynek/#findComment-238189
Udostępnij na innych stronach

  • 0
8 godzin temu, LjayPL789 napisał:

Zakładam, że wersja 1.15+ ;/
Skrypt testowałem na 1.12.2 i działał bezproblemowo - podaj wersje skripta

Wersja serwera to 1.14.4. Wersja skryptu Skript v2.4.1

Edytowane przez HeezQ
HeezQ

Usuwam formatowanie

Notatka dodana przez HeezQ

Odnośnik do komentarza
https://skript.pl/temat/37436-rozdawanie-skrzynek/#findComment-238192
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ę...