|
| 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 |
|
|
|
| 03 Apr 2016 05:34 PM |
When I say this I mean how would I do it via the Command Bar.
|
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 03 Apr 2016 05:40 PM |
But it is easy to set datastore via studio.
|
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| Joined: 05 Sep 2009 |
| Total Posts: 1593 |
|
| |
|
|
| 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
|
  |
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| Joined: 18 Nov 2012 |
| Total Posts: 757 |
|
| |
|
|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|