Skip to content
← Back to Community
How To Make A Global Log In System
Profile icon
Michael8910

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!

Voters
Profile icon
BearCoder01
Profile icon
Kingq23
Profile icon
EpicCoderGuy1
Profile icon
LuckyOreos
Profile icon
Michael8910
Comments
hotnewtop
Profile icon
[deleted]

There is errors...

Profile icon
Michael8910
Profile icon
[deleted]

@MikeJMS8910

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


@XThacker👾

Profile icon
Michael8910

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

Profile icon
[deleted]

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

Profile icon
mesquite2234

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

Profile icon
[deleted]
Profile icon
PrinceOfHeaven
Profile icon
LuckyOreos

Cooooool

Profile icon
Michael8910

@LuckyOreos thanks!