Player Data not being loaded in correctly

When a player leaves the game after about an hour of grinding. The server output tells me that their data was successfully saved. They rejoin the same server, and everything loads correctly. However, when the player joined a different server, which was the same version as the other I checked, it said successfully loaded in, but none of the stats loaded. I’m not sure what the issue here is. I have an autosave every 3 minutes, saves when you purchase a dev product, when you leave and when the server shuts down.

Code:

	local success,data = pcall(function()
		return playerData:GetAsync(prefix  .. tostring(player.UserId))
	end)
	
	if success and data then
		print("loading in data")
		for name,value in pairs(data) do
			pfolder[name].Value = value
		end
		print("data loaded in")
		
	elseif not data then
		print("player has not data, starting fresh")
		for i,v in pairs(pfolder:GetChildren()) do
			v.Value = StartSetUp[v.Name]
		end
		print("Giving new load")
		
	elseif not success then
		return warn("data could not be loaded")
	end

If more information is needed, please ask me. Much Thanks!

1 Like

So then it’s fine how it is? Little confused, cause I don’t think its the saving system unless someone wants to take a look at that.

Hello good sir or madam

Please please use DataStore2.
This is exactly why people switch constantly from roblox DS to DS2.
It’s an independant datastore for your own game which relies on the internal server cache for saving data, nevet been a single case of data loss!

Very easy to use so its no problem to switch.

Hope this helps!

Just so your response is not misleading - DataStore2 is not “independent”. It uses DataStoreService under the hood, but has that caching bonus and a few more things.

Yes but I meant to say it’s an independant module, sorry my mistake