Data Store Not Working

If im getting this issue dint you also get it?

Use game:BindToClose() to yield the game from shutting down until the server finishes saving data.

Also, did you make sure that there are a few string values before data got saved? so that when the for loop is ran then the value of ‘v’ isn’t nil:

for i,v in pairs(player.OldTasks:GetChildren()) do --make sure that value of v isnt nil
		table.insert(dataToSave, v.Name)
end
1 Like

Why do you have 2 player added functions, you only need one. Your data most likely isn’t loading due to only the first PlayerAdded function being called, combine both of them.

You also don’t have any sort of system in place in the event of data not loading properly, I’d recommend using something like Datastore2 or ProfileService.

2 Likes

datasaving.rbxl (22.4 KB)

I have made the system here. Check if it works for you. It worked perfectly for me.

Note: Data gets saved every 10s so there might me warnings about many requests to save data.

You aren’t helping the OP by just giving him the file. If you can’t help him fix his script then don’t contribute to the topic.

Saving data every 10 seconds is extremely bad, do not do that.

1 Like

Hmmm…
Ok I am sorry about that, you can change the value from 10 to whatever you want.

Wont it be Better to use Bind to Close?

Yep. In my New Script i Fixed it.

This Issue Has Been Solved!

Thanks To : @TigerLeo77 @COUNTYL1MITS @AZ9tumas !