#Test dodawania itemów. command /testGUI []: trigger: set {_x} to chest with 1 rows named "Testowe gui by ##Knugi" set slot 8 of {_x} to paper named "&7Informacja" with lore "&7Tu sa dwie opcje.||&7Pierwsza &ckamien&7 bedzie wybieralo sie za pomoca klawiatury||||&cDirt &7bedzie kolejne gui do wybierania ile do wyboru." set slot 0 of {_x} to stone named "&cPierwsza opcja" set slot 5 of {_x} to dirt named "&cDruga opcja" open {_x} to player on inventory click: if inventory name of player's current inventory is "Testowe gui by ##Knugi": cancel event if clicked slot is 0: set {_x} to chest with 1 rows named "Pierwsza opcja testowa." set slot 5 of {_x} to stone named "&7Kamien." with lore "&3Cena kupna: &c100||&3Cena sprzedazy: &c0.4||||&eLPM aby kupic||&ePPM aby sprzedac." set slot 0 of {_x} to paper named "&7Informacje" with lore "&7Najedz na przedmiot (kamien) i za pomocą przycisków nad klawiaturą (1-9)||&7ustawiamy ilosc stone do kupienia/sprzedania." set slot 1 of {_x} to paper named "&7Informacje" with lore "&7Zasada dzialania:||&7Przycisk -> co robi.||||&c1 &7- &3Dodaje 1||&c2 &7- &3Usuwa 1||&c3 &7- &3Dodaje 10||&c4 &7- &3Usuwa 10||&c5 &7- &3Ustawia na 64.||&c6 &7- &3Ustawia na 1" set slot 8 of {_x} to 330 named "Powrot" open {_x} to player if clicked slot is 5: set {_x} to chest with 2 rows named "Druga opcja testowa." set slot 0 of {_x} to stone named "&7Kamien." with lore "&3Cena kupna: &c100||&3Cena sprzedazy: &c0.4||||&eLPM aby kupic||&ePPM aby sprzedac." set slot 9 of {_x} to lever named "&c+1" set slot 10 of {_x} to lever named "&c-1" set slot 11 of {_x} to lever named "&c+10" set slot 12 of {_x} to lever named "&c-10" set slot 13 of {_x} to lever named "&c64" set slot 14 of {_x} to lever named "&c1" open {_x} to player if inventory name of player's current inventory is "Druga opcja testowa.": cancel event if clicked slot is not between 9 and 14: stop set {_amount} to amount of item player's current inventory's slot 0 if clicked slot is 9: add 1 to {_amount} if clicked slot is 10: remove 1 from {_amount} if clicked slot is 11: add 10 to {_amount} if clicked slot is 12: remove 10 from {_amount} if clicked slot is 13: set {_amount} to 64 if clicked slot is 14: set {_amount} to 1 if {_amount} is smaller than 1: set {_amount} to 1 if {_amount} is larger than 64: set {_amount} to 64 set player's current inventory's slot 0 to {_amount} of stone named "&7Kamien." with lore "&3Cena kupna: &c%{_amount} * 100%||&3Cena sprzedazy: &c%{_amount} * 0.4%||||&eLPM aby kupic||&ePPM aby sprzedac." on script load: import "org.bukkit.event.inventory.InventoryClickEvent" on "org.bukkit.event.inventory.InventoryClickEvent": set {_top} to event.getWhoClicked().getOpenInventory().getTopInventory() if name of {_top} is "Pierwsza opcja testowa.": cancel event if event.getRawSlot() is 8: set {_x} to chest with 1 rows named "Testowe gui by ##Knugi" set slot 8 of {_x} to paper named "&7Informacja" with lore "&7Tu sa dwie opcje.||&7Pierwsza &ckamien&7 bedzie wybieralo sie za pomoca klawiatury||||&cDirt &7bedzie kolejne gui do wybierania ile do wyboru." set slot 0 of {_x} to stone named "&cPierwsza opcja" set slot 5 of {_x} to dirt named "&cDruga opcja" open {_x} to event.getWhoClicked() stop if event.getRawSlot() is 5: set {_item} to event.getCurrentItem() set {_amount} to amount of item {_item} set {_hotbar} to event.getHotbarButton() if {_hotbar} is not set: stop add 1 to {_hotbar} if {_hotbar} is between 1 and 6: if {_hotbar} is 1: add 1 to {_amount} if {_hotbar} is 2: remove 1 from {_amount} if {_hotbar} is 3: add 10 to {_amount} if {_hotbar} is 4: remove 10 from {_amount} if {_hotbar} is 5: set {_amount} to 64 if {_hotbar} is 6: set {_amount} to 1 if {_amount} is smaller than 1: set {_amount} to 1 if {_amount} is larger than 64: set {_amount} to 64 set event.getWhoClicked()'s current inventory's slot 5 to {_amount} of stone named "&7Kamien." with lore "&3Cena kupna: &c%{_amount} * 100%||&3Cena sprzedazy: &c%{_amount} * 0.4%||||&eLPM aby kupic||&ePPM aby sprzedac."