Solved 2FA Skript Problem

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

gamerthings

New Member
Apr 2, 2024
9
0
1
24
Hello, I have a problem that I can't fix. When I join, my IP should be checked by /login and if it is correct from the last login I should be logged in automatically. The problem is that he logs me out again and he doesn't check my IP

The code:

JavaScript:
on join:
    if player is "GamerThings":
        if {ip.gamerthings} contains IP of player:
        execute console command "lp user GamerThings parent add owner"
        wait 60 ticks
        send "&5&lVERIFY &8> &7Wir haben dich automatisch eingeloggt."

        if {ip.gamerthings} does not contain IP of player:
        send "&5&lVERIFY &8> &cWir haben dich automatisch ausgeloggt."
        execute console command "lp user GamerThings parent remove owner"
  
command /login [<text>]:
    permission: aygaria.2fa.gamerthings
    permission message: &cThe command is not an exist! Please give an another Command!
    trigger:
        if arg 1 is equal to {loginpassword.gamerthings}:
            set {ip.gamerthings} to IP of player
            execute console command "lp user GamerThings parent set owner"
            send "&5&lVERIFY &8> &aGamerThings, &7Du hast dich erfolgreich verifiziert! &cWir haben deine IP und Zeit gespeichert!"
            execute console command "msg Valdo010 &5&lVERIFY &8> &aGamerThings &7hat sich mit der IP &a%IP of player% &7erfolgreich eingeloggt. &7Zuletzt eingeloggt: &a%player's last login%"
            execute console command "mail send Valdo010 &5&lVERIFY &8> &aGamerThings &7hat sich mit der IP &a%IP of player% &7erfolgreich eingeloggt. &7Zuletzt eingeloggt: &a%player's last login%"
            execute console command "mail send GamerThings &5&lVERIFY &8> &aGamerThings &7hat sich mit der IP &a%IP of player% &7erfolgreich eingeloggt. &7Zuletzt eingeloggt: &a%player's last login%"

        if arg 1 is not set:
            send "&5&lVERIFY &8> &cBenutzung: /login (Passwort)"
          
command /logout:
    permission: aygaria.2fa.gamerthings
    permission message: &cThe command is not an exist! Please give an another Command!
    trigger:
        execute console command "lp user GamerThings parent remove owner"
        send "&5&lVERIFY &8> &aGamerThings, &7Du hast dich erfolgreich entverifiziert!"

command /passwort [<text>]:
    permission: aygaria.2fa.gamerthings.change
    permission message: &cThe command is not an exist! Please give an another Command!
    trigger:
        set {loginpassword.gamerthings} to arg 1
        send "&5&lVERIFY &8> &aGamerThings, &7Dein neues Passwort lautet: &5&l%arg 1%"
 
Last edited:
Please format this using SkUnity's built in CODE formatting, because in it's current state this is difficult to read.