HexC3D
|
  |
| Joined: 30 Jun 2012 |
| Total Posts: 10044 |
|
|
| 16 Dec 2015 09:46 PM |
It appears to be WaitForDataReady(), gives me an infinite loop where the player is never able to save in DP..
While I heard in datastore you can't save these kinds of variables.
local Stats = {Level = nil, DataCount = nil}
And if you can list a way how please show all the steps and detail... Because there are somethings in DS I don't understand.
Never tried to completely learnd DS |
|
|
| Report Abuse |
|
|
|
| 16 Dec 2015 09:50 PM |
| You should change to the new DataStore API. DataPersistence is old. |
|
|
| Report Abuse |
|
|
|
| 16 Dec 2015 09:51 PM |
| Oops, just read the rest of your post. There's no reason why you shouldn't be able to save something like that with DS, but keep in mind that setting something to nil in a table means Lua dumps out the key. Try setting it to false if you really need to say that it's there. |
|
|
| Report Abuse |
|
|
HexC3D
|
  |
| Joined: 30 Jun 2012 |
| Total Posts: 10044 |
|
|
| 16 Dec 2015 09:53 PM |
0x, show me an example in a function that return the data in a table
like
local Datastore = game:GetService('DataStoreService'):GetDataStore('GameData') function GetData(key) return Data end |
|
|
| Report Abuse |
|
|
HexC3D
|
  |
| Joined: 30 Jun 2012 |
| Total Posts: 10044 |
|
|
| 16 Dec 2015 10:03 PM |
| Or do you use HttpService and Encode the thing or does DS have a built in one. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 16 Dec 2015 10:05 PM |
You can save tables in DS (if it's not mixed and doesn't contain any non-serializeable values like instances etc etc).
Plus you can always just JSONEncode it yourself. |
|
|
| Report Abuse |
|
|
HexC3D
|
  |
| Joined: 30 Jun 2012 |
| Total Posts: 10044 |
|
|
| 16 Dec 2015 10:11 PM |
Tried it out before you said anything cnt, lol. It seems to work smoothly, and I'm pretty mad at the person who taught me DS doesn't work via tables. |
|
|
| Report Abuse |
|
|
HexC3D
|
  |
| Joined: 30 Jun 2012 |
| Total Posts: 10044 |
|
|
| 16 Dec 2015 10:14 PM |
| WaitForDataReady() does not return anything though, I think Roblox doesn't support the feature anymore? |
|
|
| Report Abuse |
|
|
|
| 16 Dec 2015 10:15 PM |
| you're all silly it's waitfordatadone(()) |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 16 Dec 2015 10:16 PM |
Well if it just "hangs" forever, you can use the loop and check the "DataReady" property of the Player and if, say, it hasn't been changed to true in more than 30 seconds than just notify them.
Although I'm pretty sure it's still supported, still a lot of popular old games that use them and they still work. |
|
|
| Report Abuse |
|
|
|
| 16 Dec 2015 10:16 PM |
waitfordataready doesn't return anything, it just yields until dp is ready
/I have none to show to the one I love/ |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 16 Dec 2015 10:18 PM |
puu dot sh/lYxSk/ef0fca11ce.png - wiki
But the wiki could be wrong, I never run into these types of problems (I don't really script in Roblox Lua anymore so there's that) so who knows. |
|
|
| Report Abuse |
|
|