Having a question about datastores

Is it ok to save the data this way? Or can it lead to memory loss?

   local savedStats = {["Values"] = {}; ["Items"] = {}}
   table.insert(savedStats["Values"], Kills.Value)
   table.insert(savedStats["Items"], item.Name)
-- SetAsync GetASync functions etc

Data loss, not memory loss, and it can occur due to a numerous variation of factors. Most commonly it’s due to server shutdowns or ratelimits at the closing of the game.

Ideally, no, it will not lead to data loss, but you should use a cached system (which I assume you’re kind of doing, saving only upon leaving or game close) which is incorporated into standardized systems like ProfileService, which I recommend for data applications if it’s a production game, or you just want some peace of mind knowing it’s a well written data system.

1 Like

Oh! I see. Thanks for helping me!

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