DataStore trouble in my new update

Can you try your game without data and try it?

I think it is happening because the index of the old data is numbers, not names.

I don’t think it’s an issue, because when I’ve clear all my data and then played some time, it saved everything.

Yes but especially when the Roblox Server’s down it can start to error and your whole script will break!

Okay, I’ll try to do that right now.

Did you check to see if the data even exists anymore?

I did that, now it’s again broken! My treasures got reset and now problem not only for players that don’t play, but for me either lol.

Screenshot:

game:BindToClose(function()
	for i,plr in pairs(players:GetPlayers()) do
		save(plr)
	end
end)

do you really need this?

This does not relate to the problem nor fix it in any way. This code saves player data when the server is shutdown.

I don’t really know, I saw this script on devforum, and it says that it’s for, when developer shutdown servers

I don’t even know how to check it…

Read this thread about how to check the data in your datastore.


What should I do with that information?
(thats treasure data store)

You don’t have any data in the datastore. Either you changed the datastore name to something else or when it saved, it override all of your already existing data.

1 Like

I mean, I don’t know why but there is a lot of random data store keys that I never change, only if in development place to test the game. But, now I have two questions…
image

First Question - How to fix that?
Second Question - Why there is no data? And why it reseting every time if I’ll change code?
(that’s three question but nvm)

Also, it’s not the first time it happens to me, already happend something like this in my old games.
EDIT: It’s only happens to the Treasures DataStore (I don’t know why)

You can’t fix a datastore that has deleted or non-existing data.

Okay, so, why then it’s deleting with no reason?

Can someone help fixing this? I need solution, please.

Okay. Let me try and help;

We don’t have access to your place, nor much information on the past and what it looks like now. You need to first get the list of people in the treasure datastore and print them out. If nothing prints out, the data has been wiped, you can’t get it back and there is nothing that can solve it. If the data prints out, then there is no problem with the datastore and you just aren’t getting it correctly.

You can still have nothing printed out if you did it wrong. I would first print out the data, then loop through it, and then loop 1 more time.

This should give you an idea of what to do next. If not, reply. If it does work, I will not be able to help you anymore. (Basically, I will not be writing code to fix your problem. This is a learning opportunity, and I don’t get any sort of compensation from this except enhancing my problem solving skills. Feel free to still ask questions.)

1 Like

I know problem why it’s not loading datastore. In the new treasures datastore script, I’ve made it so It would save like with names of chest, but in the old datastore it saving like a number:
image

So, I guess I should just make it so it would be not a name, but a number.
Thanks for helping @KeegansPerun and recommending DataStore Editor plugin!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.