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 » Scripters
Home Search
 

Re: Stat resetting

Previous Thread :: Next Thread 
deathavenger31 is not online. deathavenger31
Joined: 11 Aug 2013
Total Posts: 477
24 Feb 2016 05:51 PM
Hey so i use data persistance(I know about datastore) and i was wondering if there is a way to reset the data store data. Like completely wipe it.


The lua Orange Belt
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
24 Feb 2016 05:53 PM
There is, if you assign a reset version number to be saved as well. If a new reset version is issued with an update, and it is newer than their reset version, wipe their data and save the newest reset version.


Report Abuse
deathavenger31 is not online. deathavenger31
Joined: 11 Aug 2013
Total Posts: 477
24 Feb 2016 05:57 PM
Im sorry but that was very confusing^


The lua Orange Belt
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
24 Feb 2016 06:08 PM
Pseudo-code:

Current_Stats_Version = 1
Player_Stats_Version = Load( "Stats_Version" ) or 0
if Player_Stats_Version < Current_Stats_Version then
Save( "Exp", 0 )
Save( "Lvl", 0 )
Save( "Gold", 0 )
Save( "Stats_Version", Current_Stats_Version )
end



Each time you want to wipe data, add 1 to Current_Stats_Version.
Then you can also, inside of the "if then", change what it saves, add new values, and so forth.


Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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