How to make a Strong DataStore

local data

local success, errorMessage = pcall(function()
	data = DataStore:SetAsync(plr.UserId)
end)

This code is making the error, its pretty self explanitory. Also you are using pcall’s without handling the outcome you should read the article i gave you fully and dont rush and paste writing code like you did here it creates really silly errors

Isn’t that correct? I looked at the article and it makes sense.

yes, its correct but you are doing nothing with the result you can do like if not success then handle the error

edit: what i would do here is use discord webhooks to alert me the issue with the data so i can recover their data manually if required.

That is incorrect, you should be using DataStore:GetAsync() for getting data.

Also, Discord webhooks are not for logging.

Thats the code from the OP, not me. I just gave the code and said “this code is making the error, its pretty self explanitory.” you should read my full post before saying its incorrect

Okay I am confused. So the data is not loading that is why it is not working?

@takticiadam You said it was correct here:


@InquistorWasBanned It is not working because the data is not loading.

Oh okay, so how do I load the data?

I think you didnt understand what I meant there, first of all why would you except me to say its incorrect then say its correct out of nowhere, what I meant there is OP is using pcall’s without handling the outcome.

Well change it to :GetAsync, thats it.

Okay let me try it right now. Do you have discord?

no, I do not have discord thing

Yes it works. But I am afraid the saving might still lose a lot of information. How can I minimize that?

If you still lose information, its probably roblox’s fault as i said. You can do nothing about that just blame them if you want to. If you really want to minimize it just use profileservice.

Okay Thanks I will try using ProfileService.

You could minimize data loss by having a retry function if the pcall failed.

How would I do that and where?

There is an example in the post I linked earlier under the DataStore errors - retrying section.

So the more pcalls I add the more strong it will be?

No, that is not what I meant. The example keeps calling the call until it returns success.