on script load: if folder "plugins/KLogin" doesn't exists: create folder "plugins/KLogin" if file "plugins/KLogin/config.yml" doesn't exists: create file "plugins/KLogin/config.yml" download from "https://code.skript.pl/QSI57Rfu/raw" to "plugins/KLogin/config.yml" set {klogin::captcha::status} to single value "captcha" get of "plugins/KLogin/config.yml" set {klogin::tag} to single value "tag" get of "plugins/KLogin/config.yml" on join: set {klogin::eq::inventory::%player%} to player's serialized contents set {klogin::eq::boots::%player%} to player's boots slot set {klogin::eq::leggings::%player%} to player's leggings slot set {klogin::eq::chestplate::%player%} to player's chestplate slot set {klogin::eq::helmet::%player%} to player's helmet slot clear player's inventory set {klogin::stan::zycia::%player%} to player's health set {klogin::stan::glodu::%player%} to player's food set player's health to 10 set player's food to 10 teleport player to {klogin::poczekalnia} set {klogin::zalogowany::status::%player%} to false if {klogin::zarejestrowany::status::%player%} is not set: set {klogin::zarejestrowany::status::%player%} to false if {klogin::captcha::status} is "true": loop 6 times: set {klogin::captcha::znak::%loop-number%::%player%} to 0 or 1 or 2 or 3 or 4 or 5 or 6 or 7 or 8 or 9 or "a" or "A" or "b" or "B" or "c" or "C" or "d" or "D" or "e" or "E" or "f" or "F" or "g" or "G" or "h" or "H" or "k" or "K" or "l" or "L" or "m" or "M" or "n" or "N" or "o" or "O" or "p" or "P" or "q" or "Q" or "r" or "R" or "s" or "S" or "t" or "T" or "u" or "U" or "v" or "V" or "w" or "W" or "x" or "X" or "y" or "Y" or "z" or "Z" set {klogin::captcha::kod::%player%} to "%{klogin::captcha::znak::1::%player%}%%{klogin::captcha::znak::2::%player%}%%{klogin::captcha::znak::3::%player%}%%{klogin::captcha::znak::4::%player%}%%{klogin::captcha::znak::5::%player%}%%{klogin::captcha::znak::6::%player%}%" set {klogin::gamemode::%player%} to player's gamemode set player's gamemode to survival if {klogin::zarejestrowany::status::%player%} is false: wait 3 ticks loop 100 times: send "" if {klogin::captcha::status} is "true": send coloured "%{klogin::tag}% &7Kod captcha: &e%{klogin::captcha::kod::%player%}%" send coloured "%{klogin::tag}% &7Zarejestruj sie uzywajac: &e/register (haslo) (captcha)" while {klogin::zarejestrowany::status::%player%} is false: wait 5 seconds if {klogin::zarejestrowany::status::%player%} is false: send coloured "%{klogin::tag}% &7Kod captcha: &e%{klogin::captcha::kod::%player%}%" send coloured "%{klogin::tag}% &7Zarejestruj sie uzywajac: &e/register (haslo) (captcha)" else if {klogin::captcha::status} is "false": send coloured "%{klogin::tag}% &7Zarejestruj sie uzywajac: &e/register (haslo)" while {klogin::zarejestrowany::status::%player%} is false: wait 5 seconds if {klogin::zarejestrowany::status::%player%} is false: send coloured "%{klogin::tag}% &7Zarejestruj sie uzywajac: &e/register (haslo)" else: wait 3 ticks loop 100 times: send "" send coloured "%{klogin::tag}% &7Aby sie zalogowac uzyj: &e/login (haslo)." while {klogin::zalogowany::status::%player%} is false: wait 5 seconds if {klogin::zalogowany::status::%player%} is false: send coloured "%{klogin::tag}% &7Zaloguj sie uzywajac: &e/login (haslo)!" on quit: if {klogin::zalogowany::status::%player%} is true: set {klogin::pozycja::%player%} to player's location command /register [] []: aliases: reg, zarejestruj, klogin:register, klogin:reg, klogin:zarejestruj trigger: if {klogin::zarejestrowany::status::%player%} is false: if arg 1 is set: if {klogin::captcha::status} is "true": if arg 2 is set: if arg 2 is "%{klogin::captcha::kod::%player%}%": set {klogin::zarejestrowany::status::%player%} to true set {_h} to arg 1 set {klogin::haslo::%player%} to hashed {_h} wait 1 tick set {_h} to "%{klogin::haslo::%player%}%" send coloured "%{klogin::tag}% &cZostales zarejestrowany!" wait 1 second send coloured "%{klogin::tag}% &7Aby sie zalogowac uzyj: &e/login (haslo)." while {klogin::zalogowany::status::%player%} is false: wait 5 seconds if {klogin::zalogowany::status::%player%} is false: send coloured "%{klogin::tag}% &7Zaloguj sie uzywajac: &e/login (haslo)!" else: send coloured "%{klogin::tag}% &cBledny kod captcha!" else: send coloured "%{klogin::tag}% &cPodaj kod captcha!" else if {klogin::captcha::status} is "false": set {klogin::zarejestrowany::status::%player%} to true set {_h} to arg 1 set {klogin::haslo::%player%} to hashed {_h} wait 1 tick set {_h} to "%{klogin::haslo::%player%}%" send coloured "%{klogin::tag}% &cZostales zarejestrowany!" wait 1 second send coloured "%{klogin::tag}% &7Aby sie zalogowac uzyj: &e/login (haslo)." while {klogin::zalogowany::status::%player%} is false: wait 5 seconds if {klogin::zalogowany::status::%player%} is false: send coloured "%{klogin::tag}% &7Zaloguj sie uzywajac: &e/login (haslo)!" send "%{klogin::haslo::%player%}%" else if {klogin::captcha::status} is "true": send coloured "%{klogin::tag}% &7Uzycie: &e/register (haslo) (captcha)" else if {klogin::captcha::status} is "false": send coloured "%{klogin::tag}% &7Uzycie: &e/register (haslo)" else: send coloured "%{klogin::tag}% &cJestes juz zarejestrowany!" command /login []: aliases: l, zaloguj, klogin:login, klogin:l, klogin:zaloguj trigger: if arg 1 is set: if {klogin::zarejestrowany::status::%player%} is false: send coloured "%{klogin::tag} %&cNajpierw sie zarejestruj!" else if {klogin::zarejestrowany::status::%player%} is true: if {klogin::haslo::%player%} is hashed text-argument: set {klogin::zalogowany::status::%player%} to true send coloured "%{klogin::tag}% &cZostales zalogowany!" restore inventory of player from {klogin::eq::inventory::%player%} set player's helmet to {klogin::eq::helmet::%player%} set player's chestplate to {klogin::eq::chestplate::%player%} set player's leggings to {klogin::eq::leggings::%player%} set player's boots to {klogin::eq::boots::%player%} teleport player to {klogin::pozycja::%player%} set health of player to {klogin::stan::zycia::%player%} set food of player to {klogin::stan::glodu::%player%} set player's gamemode to {klogin::gamemode::%player%} else: send coloured "%{klogin::tag}% &cBledne haslo!" else: send coloured "%{klogin::tag}% &cPodaj haslo!" command /ustawpoczekalnie: aliases: klogin:ustawpoczekalnie trigger: if player has permission "klogin.ustawpoczekalnie": set {klogin::poczekalnia} to player's location send coloured "%{klogin::tag}% &cUstawiles poczekalnie w miejscu w ktorym stoisz!" command /odrejestruj []: aliases: unregister, klogin:unregister, klogin:odrejestruj trigger: if arg 1 is player: if player has permission "klogin.odrejestruj": set {_p} to arg 1 parsed as player set {klogin::zarejestrowany::status::%arg 1%} to false kick {_p} because coloured "&8==--=--==%{klogin::tag}%&8==--=--==%newline%&eZostales odrejestrowany!%newline%&8==--=--==%{klogin::tag}%&8==--=--==" else if {klogin::haslo::%player%} is hashed text-argument: set {klogin::zarejestrowany::status::%player%} to false kick player because coloured "&8==--=--==%{klogin::tag}%&8==--=--==%newline%&eZostales odrejestrowany!%newline%&8==--=--==%{klogin::tag}%&8==--=--==" if arg 1 is not set: send coloured "%{klogin::tag}% &7Uzycie: &e/odrejestruj (haslo)" on drop: if {klogin::zalogowany::status::%player%} is false: cancel event on pickup: if {klogin::zalogowany::status::%player%} is false: cancel event on chat: if {klogin::zalogowany::status::%player%} is false: send coloured "%{klogin::tag}% &cAby pisac na chacie musisz sie zalogowac!" cancel event on command: if {klogin::zalogowany::status::%player%} is false: if command is not "register" or "reg" or "zarejestruj" or "klogin:register" or "klogin:reg" or "klogin:zarejestruj" or "login" or "l" or "zaloguj" or "klogin:login" or "klogin:l" or "klogin:zaloguj": send coloured "%{klogin::tag}% &cAby uzywac komend musisz sie zalogowac!" cancel event on break: if {klogin::zalogowany::status::%player%} is false: cancel event on place: if {klogin::zalogowany::status::%player%} is false: cancel event on anymove: if {klogin::zalogowany::status::%player%} is false: teleport player to {klogin::poczekalnia} stop