Data not saving for players

You need to use profile service.

Let me warn you, don’t listen to the YouTube tutorials, they’re just scams. Just copy the example code he has, then go on from there. Save player data when they leave by inserting data into the profile.Data table. Just a quick disclaimer, you’ll want to clear the table’s contents before saving more stuff, since that table is the player data, not a newly created table unlike regularly using the default standard data saving method.

Why do players even lose data in the first place?

Well, it’s because of Roblox’s lack of security in data saving. Sometimes the data can just.. fail..

This can also root from people server swapping too fast, since if one server is still trying to save their data, another server is trying to load it. It results in an error and gives out no data.

I heard of DataStore2, so why not that?

DataStore2 is old and I guess outdated, since it was made in around 2016 while profile service was made in 2019 I think. Older games do use it still, and it works just fine for them, but it’s always best to use the latest and greatest stuff.