Skocz do zawartości
  • 0

coffein pomoz!


Hexagon__

Pytanie

No to ogolnie napisalem taki skript:

on inventory click:
    if inventory name of current inventory of player is "&5&lCOBBLEX":
        cancel event
        if clicked slot is 10:
            if amount of cobblestone in player's inventory > 575:
                remove 576 cobblestone from player
                give dirt to the player
                send "{@tag} &aPrzedmiot wytworzony" to player
            else:
                send "{@tag} &cZa malo przedmiotow!"

ogolnie gdy sie klika w npcta to sie otwiera gui i zrobilem tak ze gdy sie kliknie slot 10 gdy sie ma 576 cobbla to otrzyma sie jakis przedmiot i teraz jest jeden taki problem, po tym gdy sie otwiera gui to normalnie wszystko dziala pisze mi ze mam malo przedmiotow gdy klikne 10 slot w tym gui, ale gdy klikne 2 slot w MOIM inventory nie w gui tylko w MOIM inventory to mi tez pisze ze mam malo przedmiotow ogarnia ktos cos?

CountingDogs

Wstawiam kod w code.

Notatka dodana przez CountingDogs

Odnośnik do komentarza
Udostępnij na innych stronach

  • Odpowiedzi 44
  • Dodano
  • Ostatniej odpowiedzi

Top użytkownicy dla tego pytania

Top użytkownicy dla tego pytania

Rekomendowane odpowiedzi

  • 0

Dodaj poniższy warunek:

on inventory click:
	name of player's inventory = "&5&lCOBBLEX" # sprawdza nazwe
	clicked inventory is not player's inventory # sprawdza czy gracz nie kliknal swojego ekwipunku
	cancel event
	if index of clicked slot is 10:
		#...

 

Najlepiej znajdź sobie poradnik jak robić GUI w Skript

Odnośnik do komentarza
Udostępnij na innych stronach

  • 0

@CoFFeIN04Siemka!
 

on inventory click:
    name of player's inventory = "&5&lCOBBLEX"
    clicked inventory is not player's inventory
    cancel event
    if index of clicked slot is 10:
        if amount of cobblestone in player's inventory > 575:
            remove 576 cobblestone from player
            give dirt to the player
            send "{@tag} &aPrzedmiot wytworzony" to player
        else:
            send "{@tag} &cZa malo przedmiotow!"



Wyglada to teraz tak. Ale nadal nie dziala, errory: 

[18:08:12 ERROR]: 'player's inventory' is not a slot (npc.sk, line 18: name of player's inventory = "&5&lCOBBLEX"')
[18:08:12 ERROR]: 'inventory' is not an item type (npc.sk, line 19: clicked inventory is not player's inventory')
[18:08:12 ERROR]: 'slot' is not an item type (npc.sk, line 21: if index of clicked slot is 10:')
CountingDogs

Wstawiam kod w code.

Notatka dodana przez CountingDogs

Odnośnik do komentarza
Udostępnij na innych stronach

  • 0

@CoFFeIN04

Juz zaktualizowalem do 2.5.3 
 

on inventory click:
    name of player's inventory = "&5&lCOBBLEX"
    clicked inventory is not player's inventory
    cancel event
    if index of clicked slot is 10:
        if amount of cobblestone in player's inventory > 575:
            remove 576 cobblestone from player
            give dirt to the player
            send "{@tag} &aPrzedmiot wytworzony" to player
        else:
            send "{@tag} &cZa malo przedmiotow!"


0 errorow ale nic nie dziala, gdy klikam w ten przedmiot w gui to jest jakby "UNSTEALABLE" nic sie nie dzieje

CountingDogs

Wstawiam kod w code.

Notatka dodana przez CountingDogs

Odnośnik do komentarza
Udostępnij na innych stronach

  • 0
on inventory click:
    send "1"
    name of player's inventory = "&5&lCOBBLEX"
    send "2"
    clicked inventory is not player's inventory
    send "3"
    cancel event
    send "4"
    if index of clicked slot is 10:
        send "5"
        if amount of cobblestone in player's inventory > 575:
            send "6"
            remove 576 cobblestone from player
            give dirt to the player
            send "{@tag} &aPrzedmiot wytworzony" to player
        else:
            send "7"
            send "{@tag} &cZa malo przedmiotow!"

jakie numerki pokazuje

Odnośnik do komentarza
Udostępnij na innych stronach

  • 0

@CoFFeIN04
Masz;

on inventory click:
    name of player's inventory = "&5&lCOBBLEX"
    clicked inventory is not player's inventory
    cancel event
    if index of clicked slot is 10:
        if amount of cobblestone in player's inventory > 575:
            remove 576 cobblestone from player
            give dirt to the player
            send "{@tag} &aPrzedmiot wytworzony" to player
        else:
            send "{@tag} &cZa malo przedmiotow!"

 

CountingDogs

Wstawiam kod w code.

Notatka dodana przez CountingDogs

Odnośnik do komentarza
Udostępnij na innych stronach

  • 0

@CoFFeIN04aa

masz:

on rightclick on entity:
    if display name of clicked entity is "&6&lCOBBLEX":
        execute player command "cobblex"
   
command /cobblex:
    trigger:
        open chest with 3 rows named "&5&lCOBBLEX" to player
        loop 27 times:
            set slot loop-number - 1 of player's current inventory to black stained glass pane named " "
            set player's current inventory's slot 10 to cobblestone of unbreaking 1 named "&a&lCOBBLE&2&lX" with lore "&8&m-------------------------||&8&l» &eKliknij lewym przyciskiem||&8&l» &eaby zakupic cobblex za cene||&8&l» &6&l9x stakow cobblestone||&8&m-------------------------"
            set player's current inventory's slot 13 to cobblestone of unbreaking 1 named "&a&lCOBBLE&2&lX &6&lPREMIUM" with lore "&8&m-------------------------||&8&l» &eKliknij lewym przyciskiem||&8&l» &eaby zakupic cobblex za cene||&8&l» &6&l12x cobblexow||&8&m-------------------------"
            set player's current inventory's slot 16 to cobblestone of unbreaking 1 named "&a&lCOBBLE&2&lX &5&lULTRA" with lore "&8&m-------------------------||&8&l» &eKliknij lewym przyciskiem||&8&l» &eaby zakupic cobblex za cene||&8&l» &6&l9x cobblex premium||&8&m-------------------------"

 

CountingDogs

Wstawiam kod w code.

Notatka dodana przez CountingDogs

Odnośnik do komentarza
Udostępnij na innych stronach

  • 0

@CoFFeIN04

on inventory click:
    name of player's current inventory = "&5&lCOBBLEX"
    clicked inventory is not player's inventory
    cancel event
    if index of clicked slot is 10:
        if amount of cobblestone in player's inventory > 575:
            remove 576 cobblestone from player
            give dirt to the player
            send "{@tag} &aPrzedmiot wytworzony" to player
        else:
            send "{@tag} &cZa malo przedmiotow!"


Super!!!!!!!!!!!!!! Dziala! Juz wszystko dziala dodalem "current" i git!

CountingDogs

Wstawiam kod w code.

Notatka dodana przez CountingDogs

Odnośnik do komentarza
Udostępnij na innych stronach

  • 0
on inventory click:
    name of player's current inventory = "&5&lCOBBLEX"
    clicked inventory is not player's inventory
    cancel event
    if index of clicked slot is 10:
        if amount of cobblestone in player's inventory > 575:
            remove 576 cobblestone from player
            give cobblestone named "&5&lCOBBLEX" to the player
        send "{@tag} &aPrzedmiot wytworzony" to player
    else:
        send "{@tag} &cZa malo przedmiotow!"

tak jak teraz

CountingDogs

Wstawiam kod w code.

Notatka dodana przez CountingDogs

Odnośnik do komentarza
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ę...