My datastore system works fine, I have it so when I'm unable to get the datastore (if it's failing or down) it kicks the player, however recently datstores failed and I was kicked but my data was still overwritten. Should I be kicking players or not? What is the best way to handle errors from roblox?
✓ ANSWER ACCEPTED
How to handle datastores failing from roblox?
1 answer
✓ Accepted answer
Wrap all datastore requests in pcall like so:
local success, message = pcall(function()
Datastore:SetAsync(key, data)
end)
if not success then
-- If the datastore failed, you should retry saving this player's data.
warn("Datastore failed, retry saving the players data.")
else
-- Everything worked!
print("Datastore worked, saves stats accordingly.")
end
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
I would also really recommend this article on saving data: http://robloxdev.com/articles/Saving-Player-Data