According to the ROBLOX Wiki: Data Stores can save tables.
I tried that, once saving and loading. The first code should save the table, and the second code should load the table.
local tabledatastore = game:GetService("DataStoreService"):GetDataStore(player.Name.."Knives") tabledatastore:SetAsync("Table",{ player.Cardboard.Value, --LINE 7 player["Cup of Tea"].Value, player["Diamond Camo"].Value, player["Murderer Knife"].Value, player["Neon Green"].Value, player.Paper.Value, player["Purple Galaxy"].Value, player["Rainbow Zebra"].Value, player.Waffle.Value, player["Woodland Camo"]})
Output error: 15:46:58.298 - Cannot store Array in DataStore 15:46:58.299 - Script 'Workspace.SaveLeaderboard', Line 7 15:46:58.299 - Stack End
LOADING
DSS = game:GetService("DataStoreService"):GetDataStore(player.Name.."Knives") knifetable = DSS:GetAsync("Table") if knifetable[1] then --LINE 77 player.Cardboard.Value = true Num.Value = Num.Value+1 else print("Cardboard false") end
Output error: 15:46:50.117 - Workspace.SaveLeaderboard:77: attempt to index global 'knifetable' (a nil value) 15:46:50.118 - Stack Begin 15:46:50.119 - Script 'Workspace.SaveLeaderboard', Line 77 15:46:50.120 - Stack End
You're not calling player:WaitForDataReady()
, resulting in the data being loaded before it is available, therefore resulting in a nil value.