|
| 07 Nov 2014 09:15 PM |
I was testing converting my game to Data Stores from Data Persistence, and I noticed that some of the Data was shared across all of the testers. I was wondering if making it so every player has there data saved under different key names ("lvlPlayer1", "lvlPlayer2", "lvlPlayer3", etc) would fix that, and if that would work with large amounts of people? |
|
|
| Report Abuse |
|
|
jaredmai
|
  |
| Joined: 08 Sep 2011 |
| Total Posts: 395 |
|
|
| 07 Nov 2014 09:17 PM |
This is because you need different names for each save file. Such as: local DataSaveName = plr.userId.."LvlSave" and load it the with the same way... lcoal DataLoadName = plr.userId.."LvlSave" |
|
|
| Report Abuse |
|
|
|
| 07 Nov 2014 09:19 PM |
So for each player, it saves it using a different keyname? Like: DataStore:SetAsync("Player1SaveData", 5) vs DataStore:SetAsync("Player2SaveData", 5) Like I said? |
|
|
| Report Abuse |
|
|
| |
|
| |
|
jakej78b
|
  |
| Joined: 09 Mar 2011 |
| Total Posts: 813 |
|
|
| 07 Nov 2014 09:35 PM |
| No, for each player, you need to use a different keyname or else it will use the same data for every player. Using their userId is the best way rather than using numbers, because there is no other way to indefinitely identify users other than userids. |
|
|
| Report Abuse |
|
|
|
| 07 Nov 2014 09:36 PM |
| You get what I mean, and will that work with huge amounts of players? |
|
|
| Report Abuse |
|
|
jaredmai
|
  |
| Joined: 08 Sep 2011 |
| Total Posts: 395 |
|
|
| 07 Nov 2014 10:16 PM |
| ._. Of course yes. Every userId is unique to that player and doesn't change if a player changes their username. |
|
|
| Report Abuse |
|
|