generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: DataStore - Making sure Data isn't overwritten

Previous Thread :: Next Thread 
superswordfish is not online. superswordfish
Joined: 14 Jun 2013
Total Posts: 1336
03 Jun 2014 09:50 AM
How do I make sure that the default data isn't overwritten when I save via DataStore? Also, which Data system is better for saving data when players leave/join, DataStores or Data Persistence?
Report Abuse
superswordfish is not online. superswordfish
Joined: 14 Jun 2013
Total Posts: 1336
03 Jun 2014 11:13 AM
Bump
Report Abuse
epicbreaker is not online. epicbreaker
Joined: 23 Apr 2011
Total Posts: 2791
03 Jun 2014 11:24 AM
DataStore is more reliable. It only updates when SetAysnc is called. If a server crashes and uses Data Persistence.. You lose all the Data for that current session.

You could use the .Changed event to SetAsync, which will update the players data.. When they join again, it should be set to the latest one.

If it doesnt load, perhaps try adding a wait inside the Data Store script.. You might be changing a value inside another script, causing problems with Data Store.
Report Abuse
superswordfish is not online. superswordfish
Joined: 14 Jun 2013
Total Posts: 1336
03 Jun 2014 11:48 AM
How would I use the .Changed event with DataStores? Could you give me an example?
Report Abuse
epicbreaker is not online. epicbreaker
Joined: 23 Apr 2011
Total Posts: 2791
03 Jun 2014 12:42 PM
points.Changed:connect(function(Val)
DataStore:SetAsync("Points_"..player.Name, Val)
end)
Report Abuse
superswordfish is not online. superswordfish
Joined: 14 Jun 2013
Total Posts: 1336
03 Jun 2014 05:00 PM
Oh duh lol. Thanks!
Report Abuse
epicbreaker is not online. epicbreaker
Joined: 23 Apr 2011
Total Posts: 2791
03 Jun 2014 05:35 PM
No problem, I had loads of trouble with Data Store.. Glad I could help.
Report Abuse
superswordfish is not online. superswordfish
Joined: 14 Jun 2013
Total Posts: 1336
07 Jun 2014 03:30 PM
Sorry one last question (I know this post is old, sorry about that)

I read on the Wiki that using SetAsync and GetAsync to modify DataStore values is bad, and that you should use UpdateAsync and IncrementAsync. However, why it's bad is if several servers modify the same value at once, but with saving/loading when Players join/leave, that won't happen, so is it ok?
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image