Learn to Code via Tutorials on Repl.it!

← Back to all posts
How To Make A Global Log In System
MikeJMS8910 (234)

In this tutorial, you will learn how to make a global login system. What this means is that the player's data will save even if they end the code.

So the first thing that we will need to do is have the player be able to make an account. So let's make an input for the username.

username = input()

Now that we have a way to get a username now we need to be able to give it a value. So let's make an input for the value.

value = input()

Now let's create the key for the login to connect it to the value.

db["username"] = "value"

You need to make sure that the key and value is the same to which variable you would like to save. Now that we have a way to create an account let's make a way to log in.

LogIn = input()
value = db["LogIn"]

What this does is get the value of a username. The login will need to be what the created username name is.

Now you can make a game that saves info!

Comments
hotnewtop
[deleted]

There is errors...

[deleted]

@MikeJMS8910

If you make a new account, then login in but with the wrong username, then it will have a error


@XThacker👾

MikeJMS8910 (234)

@XThacker well yeah... cause you need a valid username

[deleted]

@MikeJMS8910
At least have a sign saying that it's a invalid username, it just has a error for the syntax and stuff.

mesquite2234 (279)

@XThacker Dude, this is a tutorial, not a share post. If there's an error that you don't like, fix it yourself.