Skocz do zawartości
  • 0

Problem z gui


TheFightaz

Pytanie

Siemka,
Mam problem z GUI, mianowicie uzywam TusKe, ale nie dziala on tak jak chce, lub cos robie zle.

Mam napisany kod związany z gui, przyklad:
 

command /diler:
	trigger:
		open chest inventory named "&c&lCrafts&a&lMC&f&l.pl &8| &6&lDILER" with 3 rows to player
		wait 2 tick
		set slot 0,1,2,3,5,6,7,8,9,17,18,19,20,21,22,23,24,25,26 and 27 of player's current inventory to red stained glass pane named "" with lore "" #RED GLASS OUTSIDE GUI
		set slot 10,12,14 and 16 of player's current inventory to lime stained glass pane named "" with lore "" #LIME GLASS INSIDE GUI
		set slot 4 of player's current inventory to paper named "&7Zakupy u &6dilera" with lore "&c» &7Potrzebujesz czegos?" and "&c» &7Moze chcesz cos sprzedac?" and "&c» &7Zagadaj do niego i powiedz co chcesz." #INFO ABOUT DILLER
		set slot 11 of player's current inventory to wheat seeds named "&aKupno &cSprzętu" with lore "&c» &7Chcesz zacząć swoją przygode" and "&7z tym ciekawym &cnarkołykiem?" and "&c» &7Tu znajdziesz coś dla siebie"
		set slot 13 of player's current inventory to kelp named "&aSprzedaż &churtowa&7/&cdetaliczna" with lore "&c» &7Masz już swoje pierwsze zbiory?" and "&c» &7Sprzedaj to u &6dilera" and "&7i zarób swój pierwszy hajs!"
		set slot 15 of player's current inventory to compass named "&aInformacje &6Dilera" with lore "&c» &7Potrzebujesz informację jak zacząć?" and "&c» &7Odwiedź tą kategorie" and "&7i zobacz jak to działa"

I drugi kod odpowiadający za klikanie w gui
 

on inventory click:
	if name of player's current inventory is "&c&lCrafts&a&lMC&f&l.pl &8| &6&lSKLEP":
		clicked slot is 13:
			open chest inventory named "&c&lCrafts&a&lMC&f&l.pl &8| &6&lPLONY" with 3 rows to player
			wait 2 tick
			set slot 0,1,2,3,4,5,6,7,8,9,17,18,19,20,21,22,23,24,25,26 and 27 of player's current inventory to red stained glass pane named "" with lore "" #RED GLASS OUTSIDE GUI
			set slot 10,13 and 16 of player's current inventory to lime stained glass pane named "" with lore "" #LIME GLASS INSIDE GUI
			set slot 11 of player's current inventory to wheat seeds named "{@plon}" with lore "&7Zakup &6X1 {@plon}" and "" and "&c» &aCena &c{@plonCena1}&2$" and "{@kup}"
			set slot 12 of player's current inventory to wheat seeds named "{@plon}" with lore "&7Zakup &6X8 {@plon}" and "" and "&c» &aCena &c{@plonCena8}&2$" and "{@kup}"
			set slot 13 of player's current inventory to wheat seeds named "{@plon}" with lore "&7Zakup &6X16 {@plon}" and "" and "&c» &aCena &c{@plonCena16}&2$" and "{@kup}"
			set slot 14 of player's current inventory to wheat seeds named "{@plon}" with lore "&7Zakup &6X32 {@plon}" and "" and "&c» &aCena &c{@plonCena32}&2$" and "{@kup}"
			set slot 15 of player's current inventory to wheat seeds named "{@plon}" with lore "&7Zakup &6X64 {@plon}" and "" and "&c» &aCena &c{@plonCena64}&2$" and "{@kup}"

Problem jest taki, ze gdy klikne gdziekolwiek w moim ekwipunku, który otwiera komenda to niektóre z nich zadziałają nawet nie klikając na slot np "13" w gui.
Tak samo jak jest slot 13 w pierwszym gui, to w drugim mi nie otworzy kolejnego gui, tylko wywola komende kupna...

Odnośnik do komentarza
https://skript.pl/temat/49225-problem-z-gui/
Udostępnij na innych stronach

5 odpowiedzi na to pytanie

Rekomendowane odpowiedzi

  • 0
on inventory click:
	if name of player's current inventory is "&c&lCrafts&a&lMC&f&l.pl &8| &6&lSKLEP":
		if type of clicked inventory is chest inventory:
			if clicked slot is 13:
				open chest inventory named "&c&lCrafts&a&lMC&f&l.pl &8| &6&lPLONY" with 3 rows to player
				wait 2 tick
				set slot 0,1,2,3,4,5,6,7,8,9,17,18,19,20,21,22,23,24,25,26 and 27 of player's current inventory to red stained glass pane named "" with lore "" #RED GLASS OUTSIDE GUI
				set slot 10,13 and 16 of player's current inventory to lime stained glass pane named "" with lore "" #LIME GLASS INSIDE GUI
				set slot 11 of player's current inventory to wheat seeds named "{@plon}" with lore "&7Zakup &6X1 {@plon}" and "" and "&c» &aCena &c{@plonCena1}&2$" and "{@kup}"
				set slot 12 of player's current inventory to wheat seeds named "{@plon}" with lore "&7Zakup &6X8 {@plon}" and "" and "&c» &aCena &c{@plonCena8}&2$" and "{@kup}"
				set slot 13 of player's current inventory to wheat seeds named "{@plon}" with lore "&7Zakup &6X16 {@plon}" and "" and "&c» &aCena &c{@plonCena16}&2$" and "{@kup}"
				set slot 14 of player's current inventory to wheat seeds named "{@plon}" with lore "&7Zakup &6X32 {@plon}" and "" and "&c» &aCena &c{@plonCena32}&2$" and "{@kup}"
				set slot 15 of player's current inventory to wheat seeds named "{@plon}" with lore "&7Zakup &6X64 {@plon}" and "" and "&c» &aCena &c{@plonCena64}&2$" and "{@kup}"

 

Polecam dodawać itemy do gui przed pokazaniem go graczowi.

command /gui:
	trigger:
		set {_gui} to chest with 3 rows named "Test"
		set slot 4 of {_gui} to diamond
		open {_gui} to player

 

Odnośnik do komentarza
https://skript.pl/temat/49225-problem-z-gui/#findComment-305833
Udostępnij na innych stronach

  • 0
Godzinę temu, Shooterowy napisał:

on inventory click:
	if name of player's current inventory is "&c&lCrafts&a&lMC&f&l.pl &8| &6&lSKLEP":
		if type of clicked inventory is chest inventory:
			if clicked slot is 13:
				open chest inventory named "&c&lCrafts&a&lMC&f&l.pl &8| &6&lPLONY" with 3 rows to player
				wait 2 tick
				set slot 0,1,2,3,4,5,6,7,8,9,17,18,19,20,21,22,23,24,25,26 and 27 of player's current inventory to red stained glass pane named "" with lore "" #RED GLASS OUTSIDE GUI
				set slot 10,13 and 16 of player's current inventory to lime stained glass pane named "" with lore "" #LIME GLASS INSIDE GUI
				set slot 11 of player's current inventory to wheat seeds named "{@plon}" with lore "&7Zakup &6X1 {@plon}" and "" and "&c» &aCena &c{@plonCena1}&2$" and "{@kup}"
				set slot 12 of player's current inventory to wheat seeds named "{@plon}" with lore "&7Zakup &6X8 {@plon}" and "" and "&c» &aCena &c{@plonCena8}&2$" and "{@kup}"
				set slot 13 of player's current inventory to wheat seeds named "{@plon}" with lore "&7Zakup &6X16 {@plon}" and "" and "&c» &aCena &c{@plonCena16}&2$" and "{@kup}"
				set slot 14 of player's current inventory to wheat seeds named "{@plon}" with lore "&7Zakup &6X32 {@plon}" and "" and "&c» &aCena &c{@plonCena32}&2$" and "{@kup}"
				set slot 15 of player's current inventory to wheat seeds named "{@plon}" with lore "&7Zakup &6X64 {@plon}" and "" and "&c» &aCena &c{@plonCena64}&2$" and "{@kup}"

 

Polecam dodawać itemy do gui przed pokazaniem go graczowi.


command /gui:
	trigger:
		set {_gui} to chest with 3 rows named "Test"
		set slot 4 of {_gui} to diamond
		open {_gui} to player

 

Zapomniałem dodac, ze chodzi mi konkretnie o dany kod, którego tu nie dopisałem.
 

on inventory click:
	if name of player's current inventory is "&c&lCrafts&a&lMC&f&l.pl &8| &6&lPLONY":
		if type of clicked inventory is chest inventory:
			clicked slot is 13:
				if player's balance is greater than or equal to {@plonCena16}:
					remove {@plonCena16} from player's balance
					give player 16 wheat seeds named {@zieleOpis}													
					send "{@tag} {@kupMarihuana}"
					close player's inventory
				else:
					send "{@tag} &cNie masz wystarczająco gotówki! &8(&a{@plonCena8}&8)"
					close player's inventory

Gdy poprzednie gui w slocie ma "13" to ten kod się wykonuje, a nie otwiera gui, które dałem w kodzie wyzej

Odnośnik do komentarza
https://skript.pl/temat/49225-problem-z-gui/#findComment-305839
Udostępnij na innych stronach

  • 0
8 godzin temu, TheFightaz napisał:

Zapomniałem dodac, ze chodzi mi konkretnie o dany kod, którego tu nie dopisałem.
 


on inventory click:
	if name of player's current inventory is "&c&lCrafts&a&lMC&f&l.pl &8| &6&lPLONY":
		if type of clicked inventory is chest inventory:
			clicked slot is 13:
				if player's balance is greater than or equal to {@plonCena16}:
					remove {@plonCena16} from player's balance
					give player 16 wheat seeds named {@zieleOpis}													
					send "{@tag} {@kupMarihuana}"
					close player's inventory
				else:
					send "{@tag} &cNie masz wystarczająco gotówki! &8(&a{@plonCena8}&8)"
					close player's inventory

Gdy poprzednie gui w slocie ma "13" to ten kod się wykonuje, a nie otwiera gui, które dałem w kodzie wyzej

To zrób w to w jednym evencie zamiast dwa osobne. Powinno działać ;) 

Odnośnik do komentarza
https://skript.pl/temat/49225-problem-z-gui/#findComment-305876
Udostępnij na innych stronach

  • 0
3 godziny temu, knugi napisał:

To zrób w to w jednym evencie zamiast dwa osobne. Powinno działać ;) 

Spróbowałem, ale nadal to samo :
 

on inventory click:
	if name of player's current inventory is "&c&lCrafts&a&lMC&f&l.pl &8| &6&lSKLEP":
		clicked slot is 13:
			open chest inventory named "&c&lCrafts&a&lMC&f&l.pl &8| &6&lPLONY" with 3 rows to player
			wait 2 tick
			set slot 0,1,2,3,4,5,6,7,8,9,17,18,19,20,21,22,23,24,25,26 and 27 of player's current inventory to red stained glass pane named "" with lore "" #RED GLASS OUTSIDE GUI
			set slot 10,13 and 16 of player's current inventory to lime stained glass pane named "" with lore "" #LIME GLASS INSIDE GUI
			set slot 11 of player's current inventory to wheat seeds named "{@plon}" with lore "&7Zakup &6X1 {@plon}" and "" and "&c» &aCena &c{@plonCena1}&2$" and "{@kup}"
			set slot 12 of player's current inventory to wheat seeds named "{@plon}" with lore "&7Zakup &6X8 {@plon}" and "" and "&c» &aCena &c{@plonCena8}&2$" and "{@kup}"
			set slot 13 of player's current inventory to wheat seeds named "{@plon}" with lore "&7Zakup &6X16 {@plon}" and "" and "&c» &aCena &c{@plonCena16}&2$" and "{@kup}"
			set slot 14 of player's current inventory to wheat seeds named "{@plon}" with lore "&7Zakup &6X32 {@plon}" and "" and "&c» &aCena &c{@plonCena32}&2$" and "{@kup}"
			set slot 15 of player's current inventory to wheat seeds named "{@plon}" with lore "&7Zakup &6X64 {@plon}" and "" and "&c» &aCena &c{@plonCena64}&2$" and "{@kup}"
			if name of player's current inventory is "&c&lCrafts&a&lMC&f&l.pl &8| &6&lPLONY":
				clicked slot is 13:
					if player's balance is greater than or equal to {@plonCena16}:
						remove {@plonCena16} from player's balance
						give player 16 wheat seeds named {@zieleOpis}													#PLANT OF WEED 16
						send "{@tag} {@kupMarihuana}"
						close player's inventory
					else:
						send "{@tag} &cNie masz wystarczająco gotówki! &8(&a{@plonCena8}&8)"
						close player's inventory

 

 

12 godzin temu, Shooterowy napisał:

Spróbuj zamknąć ekwipunek gracza przed otworzeniem nastepnego.

Nie wiem, czy dobrze zrozumiałem, ale zrobiłem tak i nadal to samo : 
 

on inventory click:
	if name of player's current inventory is "&c&lCrafts&a&lMC&f&l.pl &8| &6&lSKLEP":
		clicked slot is 13:
			close player's inventory
			open chest inventory named "&c&lCrafts&a&lMC&f&l.pl &8| &6&lPLONY" with 3 rows to player
			wait 2 tick
			set slot 0,1,2,3,4,5,6,7,8,9,17,18,19,20,21,22,23,24,25,26 and 27 of player's current inventory to red stained glass pane named "" with lore "" #RED GLASS OUTSIDE GUI
			set slot 10,13 and 16 of player's current inventory to lime stained glass pane named "" with lore "" #LIME GLASS INSIDE GUI
			set slot 11 of player's current inventory to wheat seeds named "{@plon}" with lore "&7Zakup &6X1 {@plon}" and "" and "&c» &aCena &c{@plonCena1}&2$" and "{@kup}"
			set slot 12 of player's current inventory to wheat seeds named "{@plon}" with lore "&7Zakup &6X8 {@plon}" and "" and "&c» &aCena &c{@plonCena8}&2$" and "{@kup}"
			set slot 13 of player's current inventory to wheat seeds named "{@plon}" with lore "&7Zakup &6X16 {@plon}" and "" and "&c» &aCena &c{@plonCena16}&2$" and "{@kup}"
			set slot 14 of player's current inventory to wheat seeds named "{@plon}" with lore "&7Zakup &6X32 {@plon}" and "" and "&c» &aCena &c{@plonCena32}&2$" and "{@kup}"
			set slot 15 of player's current inventory to wheat seeds named "{@plon}" with lore "&7Zakup &6X64 {@plon}" and "" and "&c» &aCena &c{@plonCena64}&2$" and "{@kup}"
			if name of player's current inventory is "&c&lCrafts&a&lMC&f&l.pl &8| &6&lPLONY":
				clicked slot is 13:
					close player's inventory
					if player's balance is greater than or equal to {@plonCena16}:
						remove {@plonCena16} from player's balance
						give player 16 wheat seeds named {@zieleOpis}													#PLANT OF WEED 16
						send "{@tag} {@kupMarihuana}"
						close player's inventory
					else:
						send "{@tag} &cNie masz wystarczająco gotówki! &8(&a{@plonCena8}&8)"
						close player's inventory

 

Nieaktywny

Łączę posty.

Odnośnik do komentarza
https://skript.pl/temat/49225-problem-z-gui/#findComment-305883
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ę...