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
 

Re: Quick DataStore question.

Previous Thread :: Next Thread 
SummerEquinox is online. SummerEquinox
Joined: 25 Jun 2013
Total Posts: 2088
03 Apr 2016 05:31 PM
How would I print any player's DataStore WHILE in studio?

I know how to SetAsync in studio, but now how to GetAsync.


Report Abuse
SummerEquinox is online. SummerEquinox
Joined: 25 Jun 2013
Total Posts: 2088
03 Apr 2016 05:34 PM
When I say this I mean how would I do it via the Command Bar.


Report Abuse
error9999 is not online. error9999
Joined: 05 Sep 2009
Total Posts: 1593
03 Apr 2016 05:39 PM
I think you can't do it in the studio, but you can do it in a server in studio mode, since in normal studio you aren't connected to the datastore.
Report Abuse
SummerEquinox is online. SummerEquinox
Joined: 25 Jun 2013
Total Posts: 2088
03 Apr 2016 05:40 PM
But it is easy to set datastore via studio.


Report Abuse
SummerEquinox is online. SummerEquinox
Joined: 25 Jun 2013
Total Posts: 2088
03 Apr 2016 05:49 PM
Nobody knows?

This is how I SetAsync via Command Bar,
game:GetService("DataStoreService"):GetDataStore("Ban"):SetAsync("user_" .."Player".."_Ban","No")


Report Abuse
error9999 is not online. error9999
Joined: 05 Sep 2009
Total Posts: 1593
03 Apr 2016 05:51 PM
Wouldn't that work?
Report Abuse
SummerEquinox is online. SummerEquinox
Joined: 25 Jun 2013
Total Posts: 2088
03 Apr 2016 05:52 PM
No that is SetAsync not GetAsync, whenever I remove the argument and change to GetAsync and attempt to print it, it says that I need an argument.


Report Abuse
iondriver is not online. iondriver
Joined: 18 Nov 2012
Total Posts: 757
03 Apr 2016 05:53 PM
First off, I would use the player's userID instead of their name, since they can change their name to get around the ban. Forgive me for asking, but have you tried print(game:GetService("DataStoreService"):GetDataStore("Ban"):GetAsync("user_" .."Player".."_Ban"))?
Report Abuse
error9999 is not online. error9999
Joined: 05 Sep 2009
Total Posts: 1593
03 Apr 2016 05:55 PM
Getasync is like this:
a = game:GetService("DataStoreService"):GetDataStore("Ban"):GetAsync("user_" .."Player".."_Ban")
print(a) -- prints "no"
Report Abuse
SummerEquinox is online. SummerEquinox
Joined: 25 Jun 2013
Total Posts: 2088
03 Apr 2016 05:56 PM
Okay so I was using the ban one as a working example, it works fine with that.

But in a nutshell I have a 10 part table that DataStores what each "Staff" member does. Each Staff member has their own table, and I SetAsync whatever they do to the tenth slot each time, and move the rest up.

I need to print what is in their tenth slot.

This isn't working:
local t = print(game:GetService("DataStoreService"):GetDataStore("History"):GetAsync("user_" .."Player".."_History")) print(t[10])


Report Abuse
iondriver is not online. iondriver
Joined: 18 Nov 2012
Total Posts: 757
03 Apr 2016 05:57 PM
What is the output?
Report Abuse
SummerEquinox is online. SummerEquinox
Joined: 25 Jun 2013
Total Posts: 2088
03 Apr 2016 05:57 PM
I realized I left the print at the start of the local, but it still doesn't work. Here is the error: 18:57:18.603 - local t = (game:GetService("DataStoreService"):GetDataStore("History"):GetAsync("user_" .."Player".."_History")) print(t[1]):1: attempt to index local 't' (a nil value)


Report Abuse
error9999 is not online. error9999
Joined: 05 Sep 2009
Total Posts: 1593
03 Apr 2016 06:02 PM
Because t is a value, not a table?
It's SetAsync(key,value) and not (key,table)?

I could be wrong though.
Report Abuse
SummerEquinox is online. SummerEquinox
Joined: 25 Jun 2013
Total Posts: 2088
03 Apr 2016 06:03 PM
I am not 100% sure, because I can access it perfectly fine if they are in the game.



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