#Skrypt na motd: #KOD: #Sekcja odpowiadająca za funkcje: function MotdList(p: player): set {_gui} to chest inventory with 5 rows named "&8 Lista MOTD" set slot (integers between 0 and 8) and (integers between 36 and 44) of {_gui} to blue stained glass pane named "&3-" set slot 1, 4, 7, 37, 40, 43 of {_gui} to light blue stained glass pane named "&b-" if {RandomMotdMode} is set: set {_text} to "&aTAK" else: set {_text} to "&cNIE" set slot 40 of {_gui} to carrot named "&7Losowanie motd: %{_text}%" if {MotdList::*} is set: set {_x} to 0 loop {MotdList::*}: if {MainMotd} is not set: add 1 to {_x} add name tag named "&7Motd %{_x}%: &a%loop-value%" with lore "&6- Kliknij aby edytować" and " &6podane MOTD" and "" and "&aTo motd jest aktualenie ustawione jako główne!" to {_gui} set {MainMotd} to loop-value else: if {MainMotd} = loop-value: add 1 to {_x} add name tag named "&7Motd %{_x}%: &a%loop-value%" with lore "&6- Kliknij aby edytować" and " &6podane MOTD" and "" and "&aTo motd jest aktualenie ustawione jako główne!" to {_gui} else: add 1 to {_x} add name tag named "&7Motd %{_x}%: &a%loop-value%" with lore "&6- Kliknij aby edytować" and " &6podane MOTD" and "" and "&7Jeżeli chcesz ustawić to motd" and "&7na główne przejdź w ustawienia tego motd!" to {_gui} else: set slot (integers between 9 and 35) of {_gui} to barrier named "&cAktualnie nie masz żadnego motd!" open {_gui} to {_p} function EditMotd(p: player, motd: text): set {_gui} to chest inventory with 1 rows named "&8Edytowanie motd ""%{_motd}%""" set slot 0 of {_gui} to red shulker box named "&4Usuń" with lore " &7Po kliknięciu w ten" and " &7slot, motd o nazwie" and " &c%{_motd}% &7zostanie usunięte!" set slot 3 of {_gui} to honey bottle named "&6Edytuj treść motd %{_motd}%" with lore "&7 Po kliknięciu w ten" and " &7slot zaczniesz edycję" and "&7 podanego motd!" if {TrescMotd::%{_motd}%} is set: set {_tresc} to {TrescMotd::%{_motd}%} replace all "%%NL%%" with " [NOWA LINIJKA] " in {_tresc} set slot 4 of {_gui} to compass named "&2Aktualna treść tego motd:" with lore "&3%{_tresc}%" else: set slot 4 of {_gui} to compass named "&2To motd nie ma ustawionej treści!" if {MainMotd} = {_motd}: set slot 5 of {_gui} to lime terracotta named "&7To motd jest ustawione jako &agłówne!" else: set slot 5 of {_gui} to red terracotta named "&cJeżeli chcesz ustawić to motd jako główne, kliknij w ten slot!" set slot 8 of {_gui} to arrow named "&cPowrót do menu" open {_gui} to {_p} function MotdDeleteConfirmation(p: player, motd: text): set {_gui} to chest inventory with 1 rows named "&cChcesz usunąć motd %{_motd}%?" set slot 2 of {_gui} to red shulker box named "&4Nie" set slot 6 of {_gui} to green shulker box named "&aTak" open {_gui} to {_p} #Sekcja odpowiadająca za komendy: command /test []: trigger: if arg 1 is "reset": clear {test::*} stop if arg 1 is "check": set {_x} to 0 loop {test::*}: add 1 to {_x} if loop-value contains "[SPACEx": Set {_line} to loop-value stop loop send "%{_line}% - linja nr %{_x}%" stop set {_split::*} to split arg 1 at " " loop {_split::*}: add loop-value to {test::*} send "&aSucces" command /motd [] [] []: permission: motd.sk permission message: &cNie masz permisji! trigger: if arg 1 is not set: MotdList(player) else: if arg 1 is not "create" or "stworz" or "stwórz": send "&7Poprawne użycie: &a/motd create " stop if arg 2 is not set: send "&7Poprawne użycie: &a/motd create " stop if {MotdList::*} contains arg 2: send "&cTaki motd już istnieje!" stop if arg 3 is set: send "&cNazwa nie może być dwuczłonowa!" stop set {_x} to 0 loop {MotdList::*}: add 1 to {_x} add arg 2 to {MotdList::*} set {MotdNr::%{_x}%} to arg 2 send "&7Pomyślnie stworzono motd o nazwie &a%arg 2%" #Sekcja odpowiadająca za klikanie w GUI: on inventory click: if name of event-inventory is "&8 Lista MOTD": cancel event if clicked slot is not blue stained glass pane or light blue stained glass pane or air or barrier or carrot: set {_split::*} to split uncolored name of clicked slot at " " EditMotd(player, {_split::3}) if clicked slot is 40: if {RandomMotdMode} is not set: set {RandomMotdMode} to true else: clear {RandomMotdMode} MotdList(player) if name of event-inventory contains "&8Edytowanie motd ": cancel event if clicked slot is not air or arrow or compass: set {_split::*} to split uncolored name of event-inventory at " " replace all """" with "" in {_split::3} set {_motd} to {_split::3} if clicked slot is 0: MotdDeleteConfirmation(player, {_motd}) if clicked slot is 3: close player's inventory set {MotdEditing::%player%} to {_motd} send "&7Aby stworzyć nową linję wpisz w tekst &6""[NL]"". &7Aby zrobić spację zrób &6""[S]""&7 a żeby się nie powtarzać wpisz &6""[Sx3]"" &7aby potroić liczbę spacji! &a(Możesz tak zrobić z każdą liczbą np. &6""[Sx6]""&7)." clear {Words::%{MotdEditing::%player%}%::*} while {MotdEditing::%player%} is set: send title "&a&lTrwa edytowanie MOTD" with subtitle "&7Wpisz na chacie treść motd!" wait 3 seconds if clicked slot is 5: if {MainMotd} is not {_motd}: set {MainMotd} to {_motd} EditMotd(player, {_motd}) else: close player's inventory if clicked slot is 8: MotdList(player) if name of event-inventory contains "&cChcesz usunąć motd ": cancel event if clicked slot is 2: MotdList(player) send "&aPomyślnie anulowano!" if clicked slot is 6: set {_split::*} to split uncolored name of event-inventory at " " replace all "?" with "" in {_split::4} close player's inventory send title "&aPomyślnie usunięto!" remove {_split::4} from {MotdList::*} clear {Words::%{_split::4}%::*} #Sekcja odpowiadająca za "zczytywanie" tego co gracz napisał podczas edytowania treści MOTD: on chat: if {MotdEditing::%player%} is set: cancel event set {TrescMotd::%{MotdEditing::%player%}%} to message set {_split::*} to split message at " " loop {_split::*}: add loop-value to {Words::%{MotdEditing::%player%}%::*} send "%{Words::%{MotdEditing::%player%}%::*}%" to player clear {MotdEditing::%player%} send title "&a&lPomyślnie wpisano nazwę!" with subtitle "&7" #Sekcja odpowiadająca za tworzenie MOTD: on server list ping: if {RandomMotdMode} is set: loop {MotdList::*}: add {TrescMotd::%loop-value%} to {_FullMotdList::*} add "%loop-value% - %{TrescMotd::%loop-value%}%" to {_TrescLoop::*} if {_FullMotdList::*} is not set: set motd to "&aSkrypt na MOTD %nl% by &a&lHiri12" stop set {_motd} to random element out of {_FullMotdList::*} loop {_TrescLoop::*}: if loop-value contains {_motd}: set {_MotdName} to loop-value replace all " - " and "%{_motd}%" with "" in {_MotdName} loop {Words::%{_MotdName}%::*}: if loop-value contains "[Sx": set {_val} to loop-value stop loop if {_val} is set: replace all "[Sx" and "]" with "" in {_val} loop {_val} parsed as number times: add "[S]" to {_var::*} set {_var::*} to "%{_var::*}%" replace all "," and "and" and " " with "" in {_var::*} set {_spaces} to {_var::1} replace all "[NL] " with nl in {_motd} replace all "[S]" with " " in {_motd} set {_total} to "%{_spaces}%%{_motd}%" replace all "[Sx" and "%{_val}%]" with "" in {_total} replace all "[S]" with " " in {_total} set motd to {_total} else: set {_motd} to random element out of {_FullMotdList::*} replace all "[NL] " with nl in {_motd} replace all "[S]" with " " in {_motd} set motd to {_motd} else: if {TrescMotd::%{MainMotd}%} is not set: set motd to "&aSkrypt na MOTD %nl% by &a&lHiri12" stop loop {Words::%{MainMotd}%::*}: if loop-value contains "[Sx": set {_val} to loop-value stop loop if {_val} is set: replace all "[Sx" and "]" with "" in {_val} loop {_val} parsed as number times: add "[S]" to {_var::*} set {_var::*} to "%{_var::*}%" replace all "," and "and" and " " with "" in {_var::*} set {_spaces} to {_var::1} set {_motd} to {TrescMotd::%{MainMotd}%} replace all "[NL] " with nl in {_motd} replace all "[S]" with " " in {_motd} set {_total} to "%{_spaces}%%{_motd}%" replace all "[Sx" and "%{_val}%]" with "" in {_total} replace all "[S]" with " " in {_total} set motd to {_total} else: set {_motd} to {TrescMotd::%{MainMotd}%} replace all "[NL] " with nl in {_motd} replace all "[S]" with " " in {_motd} set motd to {_motd}