025110
|
  |
| Joined: 23 Nov 2012 |
| Total Posts: 57661 |
|
|
| 24 Jan 2015 03:04 PM |
how do you store the player AND value ie: while wait() do for _,v in pairs(game.Players:GetChildren()) do datastore:SetAsync(v.Value.Value,v) end end
R$3,055 |
|
|
| Report Abuse |
|
|
025110
|
  |
| Joined: 23 Nov 2012 |
| Total Posts: 57661 |
|
|
| 24 Jan 2015 03:08 PM |
datastore and Value are already defined btw
R$3,055 |
|
|
| Report Abuse |
|
|
025110
|
  |
| Joined: 23 Nov 2012 |
| Total Posts: 57661 |
|
| |
|
|
| 24 Jan 2015 03:26 PM |
You can set a key and value...
The best way is to store information via user ID. How to do this efficiently? Use JSON tables.
local PlayerInformation = {Player.Gold.Value, Player.Strength.Value, Player.Whatever.Value};
local PlayerID = Player.userId;
local JSONEncode = Game:GetService("HttpService").JSONEncode; PlayerInformation_JSON = JSONEncode(PlayerInformation);
:SetAsync(PlayerID, PlayerInformation_JSON);
Then use JSONDecode to decode the value to get the stats back. |
|
|
| Report Abuse |
|
|
025110
|
  |
| Joined: 23 Nov 2012 |
| Total Posts: 57661 |
|
|
| 24 Jan 2015 04:09 PM |
how do I use JSONDecode? thnx
R$3,070 |
|
|
| Report Abuse |
|
|
025110
|
  |
| Joined: 23 Nov 2012 |
| Total Posts: 57661 |
|
| |
|
| |
|
025110
|
  |
| Joined: 23 Nov 2012 |
| Total Posts: 57661 |
|
|
| 24 Jan 2015 04:36 PM |
nice jarod you got BC
and a link to the article please?
R$3,070 |
|
|
| Report Abuse |
|
|
|
| 24 Jan 2015 04:39 PM |
Not an article, just documentation. :(
http://wiki.roblox.com/index.php?title=API:Class/HttpService/JSONDecode
|
|
|
| Report Abuse |
|
|
025110
|
  |
| Joined: 23 Nov 2012 |
| Total Posts: 57661 |
|
|
| 24 Jan 2015 04:40 PM |
so PlayerInformation_JSON = JSONDecode(PlayerInformation);
R$3,070 |
|
|
| Report Abuse |
|
|
lordrambo
|
  |
| Joined: 16 Jun 2009 |
| Total Posts: 20628 |
|
|
| 24 Jan 2015 04:43 PM |
| When you save tables, doesn't it just get converted to JSON anyway? |
|
|
| Report Abuse |
|
|
025110
|
  |
| Joined: 23 Nov 2012 |
| Total Posts: 57661 |
|
|
| 24 Jan 2015 04:50 PM |
I've been using datastores
is json better
R$3,070 |
|
|
| Report Abuse |
|
|