Ask coding questions

← Back to all posts
Saving values
qadams2008 (1)

I want to save per user, wins(int), weapons(string) and, armor(string) sorry if I am asking too much

Answered by mesquite2234 (278) [earned 5 cycles]
View Answer
mesquite2234 (278)

You could use replDB

from replit import db

db["win"] = win
db["weapon"] = weapon
db["armor"] = armor

and to load

from replit import db

weapon = db["weapon"]
armor = db["armor"]
win = db["win"]
qadams2008 (1)

@mesquite2234 this would be per user right?

mesquite2234 (278)

Not really, but you could change the key names:

from replit import db

db[f"{username}:win"] = win
db[f"{username}:weapon"] = weapon
db[f"{username}:armor"] = armor