generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

if you can't set a key and value in :SetAsync

Previous Thread :: Next Thread 
025110 is not online. 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 is not online. 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 is not online. 025110
Joined: 23 Nov 2012
Total Posts: 57661
24 Jan 2015 03:20 PM
b


R$3,055
Report Abuse
DrMathematica is not online. DrMathematica
Joined: 29 Aug 2008
Total Posts: 27268
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 is not online. 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 is not online. 025110
Joined: 23 Nov 2012
Total Posts: 57661
24 Jan 2015 04:32 PM
e


R$3,070
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
24 Jan 2015 04:35 PM
Look on the wiki.
Report Abuse
025110 is not online. 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
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
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 is not online. 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 is not online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image