Alright, i’ll get straight to the point.
Somehow, my datastore isn’t reading any second data. Only one data.
Lets say i created a bool value and i saved it using json encode. Then i make another and i do the same.
local function saveData(plr,code,rewardxd,val)
local codeData = {}
print(val.Value)
codeData[code] ={Reward = rewardxd.Name, Code = code,Redeemed = val.Value}
local ToSave = http:JSONEncode(codeData)
DataStore:SetAsync(plr.UserId,ToSave)
end
Then we decode it when the player joins.
we loop through that decoded data and bam, when i try printing “v” it only prints one table.
local savedData = DataStore:GetAsync(plr.UserId)
if savedData ~= nil then
local Data = http:JSONDecode(savedData)
task.wait()
if Data ~= nil then
for i,v in pairs(Data) do
print(v) --only prints once
i dont know much about jsonDecode and encode so if you find any mistakes. Feel free to point it out.
Thanks!! 