|
| 16 Oct 2012 10:14 PM |
| I am using a levelup system I made and I want to know where the data saves and if so can I edit it? |
|
|
| Report Abuse |
|
|
L2000
|
  |
| Joined: 03 Apr 2008 |
| Total Posts: 77448 |
|
|
| 16 Oct 2012 10:17 PM |
When you save, you need to give it the name and value; you can find it using the name specified. So if you have this:
player:SaveNumber("Name", value)
Then you can load it using:
player:LoadNumber("Name")
And then editing is simple; every time you want to change it, just use player:SaveNumber() again.
|
|
|
| Report Abuse |
|
|
adark
|
  |
| Joined: 13 Jan 2008 |
| Total Posts: 6412 |
|
|
| 16 Oct 2012 10:23 PM |
The way I've always assumed DataPersistence works is that, when the Player leaves the game, their Data for that game is cleared, and any new Data is saved over it.
It warrants a test, but this seems like the most obvious implementation to me, as there is no way to actually clear the Data. |
|
|
| Report Abuse |
|
|
|
| 16 Oct 2012 10:24 PM |
^^ Yes I am trying to clear data for a game I am making. |
|
|
| Report Abuse |
|
|
|
| 16 Oct 2012 10:26 PM |
| Basically, data is saved to the server for each player, and this data is NOT cleared when the player leaves (hence, persistence). The data stays saved until it is rewritten (or a place is reset maybe? that needs testing). |
|
|
| Report Abuse |
|
|
adark
|
  |
| Joined: 13 Jan 2008 |
| Total Posts: 6412 |
|
|
| 16 Oct 2012 10:29 PM |
Just do a quick test:
Saving Bool1 and Bool2.
Join game. Bool1 can't be loaded, save Bool1 but not Bool2. Leave game. Join game. Bool1 can be loaded, but not Bool2. Save both. Leave game. Join game. Both Bool1 and Bool2 can be loaded, only save Bool2. Leave game.
If it repeatedly loops, my hypothesis is correct. |
|
|
| Report Abuse |
|
|
|
| 16 Oct 2012 10:30 PM |
| Alright let me test this theory. |
|
|
| Report Abuse |
|
|
adark
|
  |
| Joined: 13 Jan 2008 |
| Total Posts: 6412 |
|
|
| 16 Oct 2012 10:31 PM |
@AF,
I meant, the Data gets cleared on the C side when PlayerRemoving would fire, and then whatever new data is getting saved would be saved.
Add to my test: Get to where both Bool1 and Bool2 are saved. Reset the game to a baseplate, join it, leave it, set it back to the previous version. Are both still saved? |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 16 Oct 2012 11:20 PM |
Is this what you're trying to do?
whiel true and wait() do for i, v in pairs(game.Players:GetChilren()) do if v:LoadNumber("Name") == nil then v:SaveNumber("Name", Val) end end end |
|
|
| Report Abuse |
|
|
pugzy
|
  |
| Joined: 16 Aug 2007 |
| Total Posts: 11957 |
|
|
| 17 Oct 2012 12:02 AM |
| How do they make their data persistent? |
|
|
| Report Abuse |
|
|