|
| 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 |
|
|
|
| 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 |
|
|
|
| 24 Feb 2016 05:57 PM |
Im sorry but that was very confusing^
The lua Orange Belt |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|