DarkN3xus
|
  |
| Joined: 14 Apr 2013 |
| Total Posts: 94 |
|
|
| 03 Dec 2015 10:08 AM |
| Okay, I had a terrible mistake making data save on player.Name instead of player.UserId because when players change their name, their data won't load on old name instead it loads a new data for them since it's a new name. Is there anyway to retrieve old data from player.Name if I change it to player.UserId? because If I switch to player.UserId, It'll reset everyone's data and I'm sure players will get mad...Help asap. |
|
|
| Report Abuse |
|
|
|
| 03 Dec 2015 10:11 AM |
Double post yey
You could probably set up some HttpService API that'll look on the player's profile for u.
-wiki before u forum |
|
|
| Report Abuse |
|
|
DarkN3xus
|
  |
| Joined: 14 Apr 2013 |
| Total Posts: 94 |
|
| |
|
|
| 03 Dec 2015 10:14 AM |
I'm pretty sure you wouldn't be capable of doing that
-wiki before u forum |
|
|
| Report Abuse |
|
|
DarkN3xus
|
  |
| Joined: 14 Apr 2013 |
| Total Posts: 94 |
|
|
| 03 Dec 2015 10:16 AM |
| I have an idea where if the script detects an old player's data on datastore, it should transfer old player's data to new player's data, I just don't know if that's possible... |
|
|
| Report Abuse |
|
|
|
| 03 Dec 2015 10:17 AM |
You can't go through a DataStore without knowing the keys..
-wiki before u forum |
|
|
| Report Abuse |
|
|
DarkN3xus
|
  |
| Joined: 14 Apr 2013 |
| Total Posts: 94 |
|
|
| 03 Dec 2015 10:19 AM |
| The keys are player.Name.."Stats9", now is that possible? transferring from player.Name's data to player.UserId's new data? |
|
|
| Report Abuse |
|
|
|
| 03 Dec 2015 10:20 AM |
No because you don't know the player's old name -.-
-wiki before u forum |
|
|
| Report Abuse |
|
|
DarkN3xus
|
  |
| Joined: 14 Apr 2013 |
| Total Posts: 94 |
|
|
| 03 Dec 2015 10:23 AM |
| No, It's okay even tho the old player names doesn't go to new data. I just need a script where all old player.Name's data could register in new player.UserId's data... |
|
|
| Report Abuse |
|
|
DarkN3xus
|
  |
| Joined: 14 Apr 2013 |
| Total Posts: 94 |
|
|
| 03 Dec 2015 10:25 AM |
| Because if I change the :GetDataStore(player.Name.."Stats9") to :GetDataStore(player.UserId.."Stats9"), It'll reset everyone stats...Is there a way to transfer (player.Name.."Stats9") data to the new (player.UserId.."Stats9")? |
|
|
| Report Abuse |
|
|
|
| 03 Dec 2015 10:27 AM |
Lua doesn't see DataStore keys as "player names", it interprets them as strings. Meaning that if a player changes their name, the key won't change with it.
It's kinda too late now to transfer data because ROBLOX hasn't really got any simple ways to get a player's old names. Although you could make some PHP API outside ROBLOX using proxies that can get information from ROBLOX (in this case the player names from the player profiles).
But I won't be able to help you with that rn d;
-wiki before u forum |
|
|
| Report Abuse |
|
|
DarkN3xus
|
  |
| Joined: 14 Apr 2013 |
| Total Posts: 94 |
|
|
| 03 Dec 2015 10:31 AM |
| Oh, That's sad to know :c I guess I'll be changing it to UserId now and would reset everyone stats... |
|
|
| Report Abuse |
|
|
|
| 03 Dec 2015 10:33 AM |
Well you could like check if it can find the player's name in the DataStore, then set everything it found there to the player's userId in another DataStore.
If it can't find stuff for the name (example when a player changed his name), just let that go and 'reset', but save the new information to the userId.
-wiki before u forum |
|
|
| Report Abuse |
|
|
OzzyFin
|
  |
| Joined: 07 Jun 2011 |
| Total Posts: 3600 |
|
|
| 03 Dec 2015 10:34 AM |
why would you make a new datastore for each player
just make one and set the keys as players' userids |
|
|
| Report Abuse |
|
|
|
| 03 Dec 2015 10:39 AM |
I didn't say per player
ew how inefficient
-wiki before u forum |
|
|
| Report Abuse |
|
|
|
| 03 Dec 2015 10:47 AM |
@Happy
Having a datastore for each player is actually nice to do
That way you can have a datastore (Like a MySQL Table) that saves keys of each data |
|
|
| Report Abuse |
|
|