command /handel [] [] []: trigger: if arg 1 is not set: send "&0##=##" send "&7Komendy wymiany:" send "&a/handel &7- Tworzysz/akceptujesz wymiane z graczem." send "&a/handel odrzuc &7- Odrzucasz wymiane z graczem." send "&a/handel odbierz &7- Odbierasz przedmioty z depozytu." send "&a/handel banknot &7- tworzysz banknot" stop if arg 1 is "banknot": if arg 2 is set: set {_int} to "%arg 2%" parsed as integer if {_int} is integer: if player's balance is larger than or equal to {_int}: if player has enough space for 1 paper of unbreaking 1 named "&aBanknot" with lore "&6Nominal:||&c%{_int}%&a$": give paper of unbreaking 1 named "&aBanknot" with lore "&6Nominal:||&c%{_int}%&a$" to player remove {_int} from player's balance send "&c* &7Stworzyles banknot o nominale: &c%{_int}%" stop send "&c* &7Nie masz miejsca w ekwipunku." stop send "&c* &7Nie masz tyle pieniedzy. &8(&6Stan: &3%player's balance%&8}" stop send "&c* &7Podaj liczbe calkowita." stop send "&c* &7Banknot, to jest waluta, ktorej mozesz uzywac podczas wymiany.%nl%&7Klikajac prawym na banknot, przywracasz pieniadze do konta." stop if arg 1 is "odrzuc": if {wymiana::%player%.status} is "oczekiwanie" or "gotowy": if {wymiana::%{wymiana::%player%.with}%.status} is "oczekiwanie" or "gotowy": send "&c* &7Gracz &6%player% &7odrzucil wymiane z toba." to {wymiana::%player%.with} send "&c* &7Anulowales wymiane z graczem: &6%{wymiana::%player%.with}%" clear {wymiana::%{wymiana::%player%.with}%.expire} clear {wymiana::%{wymiana::%player%.with}%.with} clear {wymiana::%{wymiana::%player%.with}%.status} clear {wymiana::%player%.expire} clear {wymiana::%player%.with} clear {wymiana::%player%.status} stop send "&c* &7Nie masz zadnego zaproszenia." stop if arg 1 is "odbierz": if size of {wymiana::%player%.deposit::*} is larger than 0: loop {wymiana::%player%.deposit::*}: if player has enough space for loop-value: give loop-value to player remove loop-value from {wymiana::%player%.deposit::*} send "&c* &7Prosze, odbierz swoje przedmioty." stop send "&c* &7Nie masz nic w depozycie." stop if arg 1 is "break": if sender is console: set {_player} to "%arg 2%" parsed as offlineplayer set {_player2} to "%arg 3%" parsed as offlineplayer clear {wymiana::%{_player}%.status} clear {wymiana::%{_player2}%.status} clear {wymiana::%{_player}%.with} clear {wymiana::%{_player2}%.with} clear {wymiana::%{_player}%.trial} clear {wymiana::%{_player2}%.trial} if "%inventory name of {_player2}'s current inventory%" contains "Wymiana z": set {_i} to 0 loop 18 times: if {_player2}'s current inventory's slot {_i} is not air: give {_player2}'s current inventory's slot {_i} to {_player2} add 1 to {_i} close {_player2}'s inventory loop {wymiana::%{_player2}%.items::*}: give loop-value to {_player2} clear {wymiana::%{_player}%.items::*} clear {wymiana::%{_player2}%.items::*} stop set {_arg} to "%arg 1%" parsed as offlineplayer if {_arg} is player: send "&c* &7Nie mozesz przeprowadzic handlu z samym soba." stop if {_arg} is online: if distance between player and {_arg} is smaller than 5.1: if "%all items in player's inventory%" is "": send "&c* &7Masz puste eq." stop if "%all items in {_arg}'s inventory%" is "": send "&c* &7Gracz &6%{_arg}% &7ma puste eq." stop if {wymiana::%{_arg}%.status} is not set: set {wymiana::%{_arg}%.status} to "oczekiwanie" set {wymiana::%player%.status} to "gotowy" set {wymiana::%{_arg}%.with} to player set {wymiana::%player%.with} to {_arg} set {wymiana::%player%.expire} to 15 set {wymiana::%{_arg}%.expire} to 15 send "&c* &7Wyslales prosbe o handel do gracza: &6%{_arg}%" to player send "&c* &7Gracz: &6%player% &7wyslal prosbe do Ciebie o handel.%nl%&7Wpisz: &6/handel %player%" to {_arg} stop if {wymiana::%{_arg}%.status} is "gotowy": if {wymiana::%{_arg}%.with} is player: close {_arg}'s inventory clear {wymiana::%player%.expire} clear {wymiana::%{_arg}%.expire} wait 2 tick open chest with 2 rows named "&6Wymiana z: &r%{_arg}%" to player open chest with 2 rows named "&6Wymiana z: &r%player%" to {_arg} send "&c* &7Wloz przedmioty ktore chcesz dac dla gracza: &6%{_arg}%" to player send "&c* &7Wloz przedmioty ktore chcesz dac dla gracza: &6%player%" to {_arg} set {wymiana::%player%.status} to "setting" set {wymiana::%{_arg}%.status} to "setting" stop send "&c* &7Ten gracz juz zaprosil kogos do handlu.%nl%&7Wygasnie za: &c%{wymiana::%{_arg}%.expire}% sekund." stop if {wymiana::%{_arg}%.status} is "oczekiwanie": send "&c* &7Ten gracz juz dostal zaproszenie do handlu.%nl%&7Wygasnie za: &c%{wymiana::%{_arg}%.expire}% sekund." stop else: send "&c* &7Ten gracz juz prowadzi wymiane." stop send "&c* &7Ten gracz nie jest kolo Ciebie." stop send "&c* &7Tego gracza nie ma na serwerze." stop every 1 second: loop all players: if {wymiana::%loop-player%.debug} is set: clear {wymiana::%loop-player%.debug} if {wymiana::%loop-player%.expire} is larger than 0: remove 1 from {wymiana::%loop-player%.expire} else if {wymiana::%loop-player%.expire} is 0: clear {wymiana::%{wymiana::%loop-player%.with}%.expire} clear {wymiana::%{wymiana::%loop-player%.with}%.status} clear {wymiana::%{wymiana::%loop-player%.with}%.with} clear {wymiana::%loop-player%.expire} clear {wymiana::%loop-player%.status} clear {wymiana::%loop-player%.with} on rightclick with paper: if name of player's tool is "&aBanknot": set {_lore::*} to lore of player's tool split at "||" set {_int} to "%uncoloured {_lore::2}%" replace all "$" in {_int} with "" set {_int} to {_int} parsed as integer add {_int} to player's balance remove paper of unbreaking 1 named "&aBanknot" with lore "%lore of player's tool%" from player send "&c* &7Otrzymales &6%{_int}%$ &7z banknotu." stop stop on join: wait 3 second clear {wymiana::%player%.trial} if size of {wymiana::%player%.deposit::*} is larger than 0: if size of {wymiana::%player%.deposit::*} is 1: set {_k} to "" else if size of {wymiana::%player%.deposit::*} is 2 or 3 or 4: set {_k} to "y" else: set {_k} to "ow" send "&c* &7Masz &c%size of {wymiana::%player%.deposit::*}% &7przedmiot%{_k}% w depozycie.%nl%&7Odbierz je wpisujac: &6/handel odbierz" on quit: if {wymiana::%player%.status} is "setting" or "waiting" or "accept": set {_player2} to {wymiana::%player%.with} clear {wymiana::%{_player2}%.with} if {wymiana::%{_player2}%.status} is "setting": set {_i} to 0 loop 18 times: if {_player2}'s current inventory's slot {_i} is not air: give {_player2}'s current inventory's slot {_i} to {_player2} add 1 to {_i} clear {wymiana::%{_player2}%.items} else: loop {wymiana::%{_player2}%.items::*}: give loop-value to {_player2} clear {wymiana::%{_player2}%.items::%loop-index%} clear {wymiana::%{_player2}%.status} close {_player2}'s inventory send "&c* &7Gracz &6%player% &7wyszedl z gry." to {_player2} if {wymiana::%player%.status} is "waiting" or "accept": loop {wymiana::%player%.items::*}: add loop-value to {wymiana::%player%.deposit::*} clear {wymiana::%player%.items::%loop-index%} if "%inventory name of player's current inventory%" contains "Wymiana z": set {_i} to 0 loop 18 times: if player's current inventory's slot {_i} is not air: add player's current inventory's slot {_i} to {wymiana::%player%.deposit::*} add 1 to {_i} clear {wymiana::%player%.items::*} if {wymiana::%player%.status} is set: set {_player} to player set {_player2} to {wymiana::%player%.with} clear {wymiana::%{_player}%.status} clear {wymiana::%{_player2}%.status} clear {wymiana::%{_player}%.with} clear {wymiana::%{_player2}%.with} clear {wymiana::%{_player}%.trial} clear {wymiana::%{_player2}%.trial} on inventory click: if "%inventory name of player's current inventory%" contains "Status handlu": if slot is smaller than 0: stop cancel event #Zmien itemy.. if player's current inventory's slot slot is brown glass: if name of player's current inventory's slot slot is "&6&lZmien przedmioty": set {wymiana::%player%.status} to "setting" wait 2 tick close player's inventory wait 2 tick open chest with 2 rows named "&1Wymiana z: &r%{wymiana::%player%.with}%" to player wait 2 tick set {_i} to 0 loop 18 times: if {wymiana::%player%.items::%loop-number%} is not air: set player's current inventory's slot {_i} to {wymiana::%player%.items::%loop-number%} add 1 to {_i} clear {wymiana::%player%.items::*} if {wymiana::%{wymiana::%player%.with}%.status} is "waiting" or "accept": set {_i} to 50 loop 4 times: set {wymiana::%player%.with}'s current inventory's slot {_i} to yellow glass named "&6&lStatus" with lore "&6Gracz &c%player%:||&c* &aUstawia swoje przedmioty" add 1 to {_i} set {_i} to 5 loop 18 times: set {wymiana::%player%.with}'s current inventory's slot {_i} to air if "%loop-number / 4%" contains "." or ",": add 1 to {_i} else: add 6 to {_i} stop #Accept if player's current inventory's slot slot is light green glass: if name of player's current inventory's slot slot is "&a&lZatwierdz": set {wymiana::%player%.status} to "accept" if {wymiana::%{wymiana::%player%.with}%.status} is "accept": #Kod na wysylanie itemow. wf "[%now%] Wymiana %player% z %{wymiana::%player%.with}%:%nl% ##Itemy %player%:" to "plugins/Skript/logs/handel.log" send "&c* &aPomyslnie wymieniles przedmioty z: &6%{wymiana::%player%.with}%" to player send "&c* &aPomyslnie wymieniles przedmioty z: &6%player%" to {wymiana::%player%.with} set {_player} to {wymiana::%player%.with} loop {wymiana::%player%.items::*}: if length of "with lore %lore of loop-value%" is larger than 10: wf " - %loop-value% with lore %lore of loop-value%" to "plugins/Skript/logs/handel.log" else: wf " - %loop-value%" to "plugins/Skript/logs/handel.log" if {_player} has enough space for loop-value: add loop-value to {_player} else: add loop-value to {wymiana::%{_player}%.deposit::*} send "&c* &7Dodano &6%loop-value% &7do depozytu." to {_player} clear {wymiana::%player%.items::%loop-index%} wf " ##Itemy %{wymiana::%player%.with}%" to "plugins/Skript/logs/handel.log" loop {wymiana::%{_player}%.items::*}: if length of "with lore %lore of loop-value%" is larger than 10: wf " - %loop-value% with lore %lore of loop-value%" to "plugins/Skript/logs/handel.log" else: wf " - %loop-value%" to "plugins/Skript/logs/handel.log" if player has enough space for loop-value: add loop-value to player else: add loop-value to {wymiana::%player%.deposit::*} send "&c* &7Dodano &6%loop-value% &7do depozytu." to player clear {wymiana::%{_player}%.items::%loop-index%} clear {wymiana::%player%.status} clear {wymiana::%{wymiana::%player%.with}%.status} close player's inventory close {wymiana::%player%.with}'s inventory execute console command "handel break %player% %{wymiana::%player%.with}%" stop set player's current inventory's slot 46 to light green glass named "&6&lTwoj status" with lore "&aAkceptujesz" if {wymiana::%{wymiana::%player%.with}%.status} is "waiting": set {_i} to 50 loop 4 times: set {wymiana::%player%.with}'s current inventory's slot {_i} to light green glass named "&6&lStatus" with lore "&6Gracz &c%player%:||&c* &aZaakceptowal wymiane" add 1 to {_i} #status = {"gotowy", "oczekiwanie", "waiting", "setting", "accept"} #Odrzuc if player's current inventory's slot slot is red glass: if name of player's current inventory's slot slot is "&c&lOdrzuc": send "&c* &7Gracz &6%player% &7odrzucil wymiane z Toba." to {wymiana::%player%.with} send "&c* &7Anulowales wymiane z graczem &6%{wymiana::%player%.with}%" to player loop {wymiana::%player%.items::*}: if player has enough space for loop-value: add loop-value to player else: add loop-value to {wymiana::%player%.deposit::*} send "&c* &7Dodano &6%loop-value% &7do depozytu." to player remove loop-value from {wymiana::%player%.items::*} loop {wymiana::%{wymiana::%player%.with}%.items::*}: if {wymiana::%player%.with} has enough space for loop-value: add loop-value to {wymiana::%player%.with} else: add loop-value to {wymiana::%{wymiana::%player%.with}%.deposit::*} send "&c* &7Dodano &6%loop-value% &7do depozytu." to {wymiana::%player%.with} remove loop-value from {wymiana::%{wymiana::%player%.with}%.items::*} clear {wymiana::%{wymiana::%player%.with}%.status} clear {wymiana::%{wymiana::%player%.with}%.with} clear {wymiana::%{wymiana::%player%.with}%.items::*} clear {wymiana::%player%.status} close {wymiana::%player%.with}'s inventory clear {wymiana::%player%.with} clear {wymiana::%player%.items::*} close player's inventory on inventory close: set {_l} to "&3>>" if "%inventory name of player's current inventory%" contains "Wymiana z": if {wymiana::%player%.status} is "setting": set {_i} to 0 loop 18 times: if player's current inventory's slot {_i} is not air: add player's current inventory's slot {_i} to {wymiana::%player%.items::*} set {_exists} to true add 1 to {_i} if {_exists} is not set: if {wymiana::%player%.trial} is not set: set {wymiana::%player%.trial} to 1 else: add 1 to {wymiana::%player%.trial} send "&c* &7Musisz cos dac dla gracza. &8(&c%{wymiana::%player%.trial}%/3&8)" if {wymiana::%player%.trial} is larger than or equal to 3: if {wymiana::%{wymiana::%player%.with}%.with} is set: send "&c* &7Gracz %player% &7zakonczyl wymiane z Toba." to {wymiana::%player%.with} send "&c* &7Zakonczyles wymiane z &6%{wymiana::%player%.with}%" to player execute console command "handel break %player% %{wymiana::%player%.with}%" stop wait 2 tick open chest with 2 rows named "&6Wymiana z: &r%{wymiana::%player%.with}%" to player stop wait 2 tick open chest with 6 rows named "&1&l&oStatus handlu" to player wait 2 tick set {wymiana::%player%.status} to "waiting" set {_i} to 4 loop 6 times: set player's current inventory's slot {_i} to blue glass named "&9Przedzialka" with lore "&3<< Twoje Przedmioty||||&3Przedmioty gracza &c%{wymiana::%player%.with}% %{_l}%" add 9 to {_i} set {_i} to 50 if {wymiana::%{wymiana::%player%.with}%.status} is "accept": set {wymiana::%{wymiana::%player%.with}%.status} to "waiting" set {wymiana::%player%.with}'s current inventory's slot 46 to white glass named "&6&lTwoj status" with lore "&aCzekasz" loop 4 times: if {wymiana::%{wymiana::%player%.with}%.status} is not "setting": set {wymiana::%player%.with}'s current inventory's slot {_i} to white glass named "&6&lStatus" with lore "&6Gracz &c%player%||&c* &aCzeka" if {wymiana::%{wymiana::%player%.with}%.status} is "setting": set player's current inventory's slot {_i} to yellow glass named "&6&lStatus" with lore "&6Gracz &c%{wymiana::%player%.with}%||&c* &aUstawia swoje itemy" if {wymiana::%{wymiana::%player%.with}%.status} is "waiting": set player's current inventory's slot {_i} to white glass named "&6&lStatus" with lore "&6Gracz &c%{wymiana::%player%.with}%||&c* &aCzeka" if {wymiana::%{wymiana::%player%.with}%.status} is "accept": set player's current inventory's slot {_i} to light green glass named "&6&lStatus" with lore "&6Gracz &c%{wymiana::%player%.with}%||&c* &aZaakceptowal wymiane" add 1 to {_i} add 1 to {_i} set player's current inventory's slot 48 to light green glass named "&a&lZatwierdz" with lore "&aKliknij aby:||&c* Zaakceptowac wymiane z graczem &6%{wymiana::%player%.with}%" set player's current inventory's slot 47 to red glass named "&c&lOdrzuc" with lore "&aKliknij aby:||&c*Odrzucic wymiane z graczem &6%{wymiana::%player%.with}%" set player's current inventory's slot 45 to brown glass named "&6&lZmien przedmioty" with lore "&aKliknij aby:||&c* Zmienic swoje przedmioty" set player's current inventory's slot 46 to white glass named "&6&lTwoj status" with lore "&aCzekasz" set {_i} to 0 loop 18 times: set player's current inventory's slot {_i} to {wymiana::%player%.items::%loop-number%} if "%loop-number / 4%" contains "." or ",": add 1 to {_i} else: add 6 to {_i} if {wymiana::%{wymiana::%player%.with}%.status} is not "setting": set {_i} to 5 loop 18 times: set {wymiana::%player%.with}'s current inventory's slot {_i} to {wymiana::%player%.items::%loop-number%} if "%loop-number / 4%" contains "." or ",": add 1 to {_i} else: add 6 to {_i} set {_i} to 5 loop 18 times: set player's current inventory's slot {_i} to {wymiana::%{wymiana::%player%.with}%.items::%loop-number%} if "%loop-number / 4%" contains "." or ",": add 1 to {_i} else: add 6 to {_i} stop on inventory close: set {_l} to "&3>>" if "%inventory name of player's current inventory%" contains "Status handlu": if {wymiana::%player%.status} is "waiting" or "accept": wait 2 tick open chest with 6 rows named "&1&l&oStatus handlu" to player wait 2 tick set {wymiana::%player%.status} to "waiting" set {_i} to 4 loop 6 times: set player's current inventory's slot {_i} to blue glass named "&9Przedzialka" with lore "&3<< Twoje Przedmioty||||&3Przedmioty gracza &c%{wymiana::%player%.with}% %{_l}%" #with lore "&3<< Twoje Przedmioty||||&3Przedmioty gracza &c%{wymiana::%player%.with}% &3>>" add 9 to {_i} set {_i} to 50 loop 4 times: if {wymiana::%{wymiana::%player%.with}%.status} is not "setting": set {wymiana::%player%.with}'s current inventory's slot {_i} to white glass named "&6&lStatus" with lore "&6Gracz &c%player%||&c* &aCzeka" if {wymiana::%{wymiana::%player%.with}%.status} is "setting": set player's current inventory's slot {_i} to yellow glass named "&6&lStatus" with lore "&6Gracz &c%{wymiana::%player%.with}%||&c* &aUstawia swoje itemy" if {wymiana::%{wymiana::%player%.with}%.status} is "waiting": set player's current inventory's slot {_i} to white glass named "&6&lStatus" with lore "&6Gracz &c%{wymiana::%player%.with}%||&c* &aCzeka" if {wymiana::%{wymiana::%player%.with}%.status} is "accept": set player's current inventory's slot {_i} to light green glass named "&6&lStatus" with lore "&6Gracz &c%{wymiana::%player%.with}%||&c* &aZaakceptowal wymiane" add 1 to {_i} add 1 to {_i} set player's current inventory's slot 48 to light green glass named "&a&lZatwierdz" with lore "&aKliknij aby:||&c* Zaakceptowac wymiane z graczem &6%{wymiana::%player%.with}%" set player's current inventory's slot 47 to red glass named "&c&lOdrzuc" with lore "&aKliknij aby:||&c*Odrzucic wymiane z graczem &6%{wymiana::%player%.with}%" set player's current inventory's slot 45 to brown glass named "&6&lZmien przedmioty" with lore "&aKliknij aby:||&c* Zmienic swoje przedmioty" set {_i} to 0 loop 18 times: set player's current inventory's slot {_i} to {wymiana::%player%.items::%loop-number%} if "%loop-number / 4%" contains "." or ",": add 1 to {_i} else: add 6 to {_i} if {wymiana::%{wymiana::%player%.with}%.status} is not "setting": set {_i} to 5 loop 18 times: set {wymiana::%player%.with}'s current inventory's slot {_i} to {wymiana::%player%.items::%loop-number%} if "%loop-number / 4%" contains "." or ",": add 1 to {_i} else: add 6 to {_i} set {_i} to 5 loop 18 times: set player's current inventory's slot {_i} to {wymiana::%{wymiana::%player%.with}%.items::%loop-number%} if "%loop-number / 4%" contains "." or ",": add 1 to {_i} else: add 6 to {_i} if {wymiana::%player%.status} is "accept": set player's current inventory's slot 46 to light green glass named "&6&lTwoj status" with lore "&aAkceptujesz" if {wymiana::%player%.status} is "waiting": set player's current inventory's slot 46 to white glass named "&6&lTwoj status" with lore "&aCzekasz" on drop: if {wymiana::%player%.status} is "setting": cancel event #------------------------------------------------- TOPKA SKRYPTU wykonanego przez Knugi <3 -----------------------------------------------------# #V 4.0