Skocz do zawartości
  • 0

Stack Size


Nieaktywny

Pytanie

Rekomendowane odpowiedzi

  • 0
3 godziny temu, KrejzolekPRO napisał:

set {_slot} to slot at bone named "kupa" in player's inventory 
set {_ilosc} to amount of item in slot {_slot} in player's inventory

 

Mi chodzi bardziej o takie coś

if amount of item of player is more than or equal to 2:

Napisałem to tera, ale to liczy itemy w całym eq zamiast tylko w dłoni.

Jak zrobić aby liczyło ilość tylko w dłoni ?

Odnośnik do komentarza
https://skript.pl/temat/18945-stack-size/#findComment-129208
Udostępnij na innych stronach

  • 0
18 godzin temu, xN0MANDx napisał:

Mi chodzi bardziej o takie coś


if amount of item of player is more than or equal to 2:

Napisałem to tera, ale to liczy itemy w całym eq zamiast tylko w dłoni.

Jak zrobić aby liczyło ilość tylko w dłoni ?

No i teraz sprawdzasz:

#{_ilosc} = liczba przedmiotow w dloni
if {_ilosc} > 2:

 

Odnośnik do komentarza
https://skript.pl/temat/18945-stack-size/#findComment-129249
Udostępnij na innych stronach

  • 0
2 godziny temu, KrejzolekPRO napisał:

No i teraz sprawdzasz:


#{_ilosc} = liczba przedmiotow w dloni
if {_ilosc} > 2:

 

No, ale item tak   - wyszukuje o pewnej nazwie   - a mi chodzi o ten który aktualnie mam w ręku (aby samo ustaliło slot - coś w stylu co tera zmyślam i pewnie nie działa set {_slot} to slot of player's hand

Odnośnik do komentarza
https://skript.pl/temat/18945-stack-size/#findComment-129283
Udostępnij na innych stronach

  • 0
4 minuty temu, xN0MANDx napisał:

No, ale item tak   - wyszukuje o pewnej nazwie   - a mi chodzi o ten który aktualnie mam w ręku (aby samo ustaliło slot - coś w stylu co tera zmyślam i pewnie nie działa set {_slot} to slot of player's hand

set {_slot} to slot at player's tool in player's inventory

 

Odnośnik do komentarza
https://skript.pl/temat/18945-stack-size/#findComment-129284
Udostępnij na innych stronach

  • 0
3 minuty temu, KrejzolekPRO napisał:

set {_slot} to slot at player's tool in player's inventory

 

Oj coś nie psztyka

[20:30:03 ERROR]: 'player's tool in player's inventory' is not a text (Kowal.sk, line 3: set {_slot} to slot at player's tool in player's inventory')
[20:30:03 ERROR]: 'in slot {_slot} in player's inventory' is not an item stack (Kowal.sk, line 4: set {_ilosc} to amount of item in slot
{_slot} in player's inventory')

#### KOD NIŻEJ

        set {_slot} to slot at player's tool in player's inventory
        set {_ilosc} to amount of item in slot {_slot} in player's inventory
        if {_ilosc} is more than or equal to 2:

 

Odnośnik do komentarza
https://skript.pl/temat/18945-stack-size/#findComment-129287
Udostępnij na innych stronach

  • 0
4 minuty temu, xN0MANDx napisał:

Oj coś nie psztyka


[20:30:03 ERROR]: 'player's tool in player's inventory' is not a text (Kowal.sk, line 3: set {_slot} to slot at player's tool in player's inventory')
[20:30:03 ERROR]: 'in slot {_slot} in player's inventory' is not an item stack (Kowal.sk, line 4: set {_ilosc} to amount of item in slot
{_slot} in player's inventory')

#### KOD NIŻEJ

        set {_slot} to slot at player's tool in player's inventory
        set {_ilosc} to amount of item in slot {_slot} in player's inventory
        if {_ilosc} is more than or equal to 2:

 

 set {_slot} to slot at player's tool
 set {_ilosc} to amount of item in slot {_slot} of player's current inventory
 if {_ilosc} is more than or equal to 2:

Może tak?

Edytowane przez KrejzolekPRO
Odnośnik do komentarza
https://skript.pl/temat/18945-stack-size/#findComment-129291
Udostępnij na innych stronach

  • 0
1 minutę temu, KrejzolekPRO napisał:

 set {_slot} to slot at player tool's of player's inventory
 set {_ilosc} to amount of item in slot {_slot} of player's inventory
 if {_ilosc} is more than or equal to 2:

Może tak?

Nadal błąd

[20:33:43 ERROR]: 'player's inventory' is not an item stack (Kowal.sk, line 3: set {_slot} to slot at player tool's of player's inventory')
[20:33:44 ERROR]: 'player's inventory' is not an item stack (Kowal.sk, line 4: set {_ilosc} to amount of item in slot {_slot} of player's inventory')

 

Odnośnik do komentarza
https://skript.pl/temat/18945-stack-size/#findComment-129292
Udostępnij na innych stronach

  • 0
Teraz, xN0MANDx napisał:

Nadal błąd


[20:33:43 ERROR]: 'player's inventory' is not an item stack (Kowal.sk, line 3: set {_slot} to slot at player tool's of player's inventory')
[20:33:44 ERROR]: 'player's inventory' is not an item stack (Kowal.sk, line 4: set {_ilosc} to amount of item in slot {_slot} of player's inventory')

 

Poprawiłem poprzedni komentarz.

Odnośnik do komentarza
https://skript.pl/temat/18945-stack-size/#findComment-129293
Udostępnij na innych stronach

  • 0
3 minuty temu, KrejzolekPRO napisał:

Poprawiłem poprzedni komentarz.

Ehhh coś nadal nie działa :/

[20:37:48 ERROR]: 'player's tool' is not a text (Kowal.sk, line 3: set {_slot} to slot at player's tool')
[20:37:48 ERROR]: 'player's current inventory' is not an item stack (Kowal.sk, line 4: set {_ilosc} to amount of item in slot {_slot} of player's current inventory')

 

Odnośnik do komentarza
https://skript.pl/temat/18945-stack-size/#findComment-129294
Udostępnij na innych stronach

  • 0
11 minut temu, xN0MANDx napisał:

Ehhh coś nadal nie działa :/


[20:37:48 ERROR]: 'player's tool' is not a text (Kowal.sk, line 3: set {_slot} to slot at player's tool')
[20:37:48 ERROR]: 'player's current inventory' is not an item stack (Kowal.sk, line 4: set {_ilosc} to amount of item in slot {_slot} of player's current inventory')

 

w 1 - player tool's

w 2 - player current inventory 

Odnośnik do komentarza
https://skript.pl/temat/18945-stack-size/#findComment-129296
Udostępnij na innych stronach

  • 0
9 minut temu, knugi napisał:

@xN0MANDx chcesz pobrać ilość przedmiotu z ręki ? Dobrze zrozumiałem?

Tak bo ludzie by mogli tak to ulepszać 64 itemy na raz nawet dlatego chce zrobić że jeżeli ktoś ma w ręcy o 1 item za dużo to kod się stopuje. (max 1 item w ręcy tylko if player has only one item in player's hand <-- Takie coś tylko działające

Odnośnik do komentarza
https://skript.pl/temat/18945-stack-size/#findComment-129333
Udostępnij na innych stronach

  • 0

Tak trochę łopatologicznie to zrobiłem ale działa.

Jeszcze się pobawię, bo wiem, że kiedyś coś zrobiłem tylko nie pamiętam expressiona, bo były chyba 3 złączone w jeden :D

A chwilowo musisz się zadowolić tym:

command /t:
	trigger:
		set {_item} to "%player's tool%"
		set {_item} to "%first 1 character of {_item}%" parsed as integer
		if {_item} is integer:
			send "&7Blad. Musisz miec jeden przedmiot w rece!"
			stop
		send "&7Jest OK!"

 

Odnośnik do komentarza
https://skript.pl/temat/18945-stack-size/#findComment-129335
Udostępnij na innych stronach

  • 0
if item amount of player's tool is 1:

Wystarczyło zajrzeć do aktualnej dokumentacji skripta: https://bensku.github.io/Skript/expressions.html#ExprItemAmount (w przykładzie użycia jest pokazane jak wyświetlić ilość przedmiotów, które gracz trzyma w ręce).

Odnośnik do komentarza
https://skript.pl/temat/18945-stack-size/#findComment-129347
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ę...