Skocz do zawartości
  • 0

Konfiguracja GUI w yml


_MicX_

Pytanie

4 odpowiedzi na to pytanie

Rekomendowane odpowiedzi

  • 0

Zależy jak to rozumiesz... Bo można w pliku zapisać całe inventory/poszczególny item, np poprzez:

set yaml value "inventory" from file "plugins/Skript/ymlInventory.yml" to inventory of player

set yaml value "item" from file "plugins/Skript/ymlInventory.yml" to tool of player

Lub zrobić powiedzmy taką konfigurację jak ma ChestCommands, tj.

Np.
GUI:
  przykładoweGui:
    name: '&5Nazwa GUI'
    rows: 6
    slots:
      0:
        item: potato
        name: '&6Ziemniak"
        lore: 'lore'
        command: 'give player 1 potato'
      1:
        item: stone
        name: 'I tak dalej...'

 

Odnośnik do komentarza
https://skript.pl/temat/29758-konfiguracja-gui-w-yml/#findComment-195491
Udostępnij na innych stronach

  • 0
on script load:
	if yaml value "nazwa_gui" from file "../../Gui/config.yml" is not set:
		set yaml value "nazwa_gui" from file "../../Gui/config.yml" to "GUI"
		set {name::gui} to yaml value "nazwa_gui" from file "../../Gui/config.yml"
		stop
	set {name::gui} to yaml value "nazwa_gui" from file "../../Gui/config.yml"
	stop
	
command /opengui [<text>]:
	trigger:
		if {name::gui} is not set:
			send "&4&lBLAD &7config jest zle ustawiony - popraw to." to the player
			stop
		open chest with 1 row named "%coloured {name::gui}%" to the player

Jeśli wpiszesz /opengui to otworzy Ci się GUI z nazwą ustawioną w configu.
Życzę miłego użytkowania.

Odnośnik do komentarza
https://skript.pl/temat/29758-konfiguracja-gui-w-yml/#findComment-195492
Udostępnij na innych stronach

  • 0
W dniu 4.10.2018 o 14:29, LuckyPotato napisał:

 


GUI:
  przykładoweGui:
    name: '&5Nazwa GUI'
    rows: 6
    slots:
      0:
        item: potato
        name: '&6Ziemniak"
        lore: 'lore'
        command: 'give player 1 potato'
      1:
        item: stone
        name: 'I tak dalej...'

 

@LuckyPotato a jak zrobić aby uzyskać taką konfigurację

Edytowane przez kijl
Odnośnik do komentarza
https://skript.pl/temat/29758-konfiguracja-gui-w-yml/#findComment-195511
Udostępnij na innych stronach

  • 0

zapisywanie takiego yml:

set yaml value "GUI.PrzykladoweGui.name" from file "FILE" to "nazwa"
set yaml value "GUI.PrzykladoweGui.rows" from file "FILE" to 6
set yaml value "GUI.PrzykladoweGui.slots.0.item" from file "FILE" to "diamond axe"
set yaml value "GUI.PrzykladoweGui.slots.0.name" from file "FILE" to "&6Boska Siekierka"
set yaml value "GUI.PrzykladoweGui.slots.0.lore" from file "FILE" to "&6Siekierka Od xAxee"

Odczytywanie (NW CZY DZIAŁA)

command /LUL [<text>]:
	trigger:
		set {_nazwa} to yaml value "GUI.PrzykladoweGui.name" from file "FILE"
		set {_rows} to yaml value "GUI.PrzykladoweGui.rows" from file "FILE"
		set {_item} to yaml value "GUI.PrzykladoweGui.slots.0.item" from file "FILE"
		set {_itemNazwa} to yaml value "GUI.PrzykladoweGui.slots.0.name" from file "FILE"
		set {_itemlore} to yaml value "GUI.PrzykladoweGui.slots.0.lore" from file "FILE"
		open chest with {_rows} named "%{_nazwa}%"
		set player's current inventory's slot 0 to {_item} parsed as item named "%{_itemNazwa}%" with lore "%{_itemlore}%"

 

Odnośnik do komentarza
https://skript.pl/temat/29758-konfiguracja-gui-w-yml/#findComment-195749
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ę...