Players data store doesnt save

Hello,

A “currency” you earn within my game is doing laps of a racing track, however what used to work doesnt anymore and I’m really not sure why.

function SaveData(player)
end
if player.leaderstats then
player:SaveNumber (“LapsD”, player.leaderstats.Laps.Value)
end

Can anyone help out to why the data save is broken now?

Thank you!

Is that data persistence? That’s long been removed. You should take a look at datastore service to save data.

1 Like

I agree this is 100% outdated and no longer functional.

I would recommend using wiki and creating a set of functions for saving data so you can make life a bit easier.

The Wiki:

Here is an example of what I have done and made public to make life easier:

– I recommend reading through and understanding code. So I would recommend creating your own set of functions built the way you want them.(Not everyone will want to use them in the same ways or formats).

1 Like

Other than normal DataStores as @UntitledProtocol and @minimic2002 said you can learn to use DataStore2 but I heard it has the problem of duplication.

Sources:

Looking at the sources you will see that DataStore2 just makes things more complicated than they need to be

It offers no real advantage over the normal DataStores.
Combine that with its bugs
and having to save data with different functions.

It may be that someone might have some sort of use for it . But you can do all that with normal DataStores anyway.

For me id say steer clear of them. Its better to become completely familiar with what your using so stick with DataStores as they have a lot more to offer than what most people think.

This is false. Datastore2 / related wrappers offer a huge advantage : Data is automatically versioned and backed up. If anything were to ever happen on production where you wanted to roll back player-data to a given date & time, you would be able to do so because of the backed up keys.

1 Like