How come this script won't autosave? (RESOLVED)

You can write your topic however you want, but you need to answer these questions:
I would like to know why this script won’t auto save the leaderstats.

The script won’t auto save the wins and points.

I retried it over and over again, but it won’t work.
why does it not auto save

What I meant by the script not auto saving, I mean how come the wins and point don’t auto save after I add a Data store.

How do you know it’s not saving? It seems like you’re just not setting your leader stats to the saved value whenever the player joins – essentially you keep resetting the stats to 0 each time.

Ah, I know it’s not saving because when I join and get a win leave and rejoin it’s gone.

He’s sayings your not changing the values to the saved values. In other words, there is no code to LOAD the data.

Also, the server could have already closed when the data is saving, u need to use game:BindToClose() to keep it open until the data is actually saved

Oh, that’s what you mean. Ok thanks I’ll look into it and try to fix it. I didn’t notice lol

You never even loaded the data yet, that’s why. And, it’s

player.UserId

Not

player.UsrID

As I said, you didn’t load the data anywhere on the script, that’s why your data isn’t “loading”.

Yeah that was a typo, but it wouldn’t have worked anyways since I never loaded it. Thanks though.