Problems with saving/loading tables specific to the player. How do I sort my problem out?
Hello,
I have got a script in ServerScriptService and a local script in the PlayerGui. The server script saves and receives/gives information from/to the local script which tells the server if something has happened with the local parts that are cloned in.
My error is that when I save a table and load it, I can't loop through the table.
Saving in the server script:
1 | Datastore:SetAsync(collectiblesID, playerDS) |
and loading:
1 | playerDS = Datastore:GetAsync(collectiblesID) |
The variables are as follows:
1 | local Datastore = game:GetService( "DataStoreService" ):GetDataStore( "TestDataStore" ) |
3 | local collectiblesID = player.UserId.. "-cc" |
4 | local playerDS = storedData [ player.Name ] |
The main problem is, when looping through storedData using:
1 | for a,b in pairs (storedData) do |
instead of printing whatever b is meant to be (a 1-3 digit combination depending on the playr's progress), it simply prints "table: 38E35AE8" (the 38E35AE8 changes every time).
If I can receive any help on this, thank you.