Hey Mr… zaza…?,
Waiting arbitrarily for data to load isn’t the most reliable way. Datastore requests can take time or even fail. With this code logic your player data might appear loaded even when it isn’t.
So saving data that hasn’t actually loaded yet causes data that were not yet set to be saved. (the data wipes)
Waiting an arbitrary amount of time then just saying “this data Loaded” is a logic error. Consider making sure “gd” actually has a value before marking the player data as “Loaded”.
This is kind of saving is bad because sometimes DataStore requests can take up to 10 seconds or more, and/or sometimes they throw out an error which can cause issues if not handled correctly.
Let’s say the server rejected our DataStore request…
502: API Services rejected request with error. Error code: 0 Reason: An internal server error occurred.
When DataStores throw an error with this code you provided, Player data will never be loaded since there is no code checking if it loaded or if the request failed!
But the Loaded.Value = true will still run… You see where I’m going with this?
Player leaving will completely wipe their data since they were never loaded but appeared as loaded.
How can you fix it?
Error handling
- Wrap your
DataStore:GetAsync()call in apcallfunction. This catches any errors during the request. - After the
pcall, check if there were any errors. If so, try loading the data again.
Loading
- set
nv.Value = trueright after you set all your values for the player.
Though if you are looking for a simpler way to store data I would reccommend checking out ProfileService, which makes storing player data a whole lot easier. (A lot of developers use this too!)
Edit:
I’m sorry I did not address this sooner. Apparently I had an oversight and the “Player Data Loaded” variable is actually not waiting arbitrarily for the data to load in at all.
It’s just delaying Player data loading in & the “Loaded” value getting set!
Hopefully you managed to fix it already ![]()

