Solved my two-factor authenfication skript has problems

  • 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

Member
Apr 2, 2024
10
0
1
25
Code:
on join:
  if "%player%" is "GamerThings":
    if {ip.gamerthings} contains IP of player: (correcting to if player is "GamerThings":)
    execute console command "lp user %player% parent set fakeowner"
    send "&9&l2FA &8» &aGamerThings, &7For security reasons, we have logged you out and removed all rights.
else:
    wait 60 ticks
    execute console command "lp user %player% parent set owner"
    send "&9&l2FA &8» &aGamerThings, &7We marked you as “trustworthy” based on your IP address and automatically logged you in."

command /login [<text>]:
    permission: aygaria.2fa.gamerthings
    permission message: &9&l2FA &8» &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 remove fakeowner"
            execute console command "lp user GamerThings parent set owner"
            send "&9&l2FA &8» &aGamerThings, &7You have successfully verified yourself! &cWe have saved your IP and time!"
            set {lastlogin.2fa} to %IP of player%.%time%

        if arg 1 is not set:
            send "&9&l2FA &8» &cUsage: /login (Password)"
Hello somehow the script doesn't load and does "else:" report as an error. Can you help me?
 
Last edited:
Making another post wasn't necessary, but basically your else statement isn't properly indented, and even if it was, it would throw an error because of your formatting. Please change your if on line 2 statement to read
Code:
if player is "GamerThings":
 
I deleted the last post and the problem is that "Either he hasn't set the IP or the IP isn't checked, I need help with that!"
 
Last edited:
Code:
on join:
  if player is "GamerThings":
    if {ip.gamerthings} contains player's IP:
    execute console command "lp user GamerThings parent set owner"
    wait 100 ticks
    send "&9&l2FA &8» &aGamerThings, &7Wir haben Sie anhand Ihrer IP-Adresse als &a„vertrauenswürdig“ &7markiert und Sie automatisch angemeldet."
  else:
    execute console command "lp user GamerThings parent set fakeowner"
    wait 100 ticks
    send "&9&l2FA &8» &aGamerThings, &cAus Sicherheitsgründen haben wir Sie abgemeldet und alle Rechte entfernt. Bitte melden sie sich erneut an!"
Is that correct?
 
Not quite. Try this
Python:
on join:
    if player is "GamerThings":
        if {ip.gamerthings} contains player's IP:
            execute console command "lp user GamerThings parent set owner"
            wait 100 ticks
            send "&9&l2FA &8» &aGamerThings, &7Wir haben Sie anhand Ihrer IP-Adresse als &a„vertrauenswürdig“ &7markiert und Sie automatisch angemeldet."
        else:
            execute console command "lp user GamerThings parent set fakeowner"
            wait 100 ticks
            send "&9&l2FA &8» &aGamerThings, &cAus Sicherheitsgründen haben wir Sie abgemeldet und alle Rechte entfernt. Bitte melden sie sich erneut an!"
 
Thank you very much, now it finally works, that was apparently the arrangement of “if”. I'll close this now and thank you :]