Hey guys! I was wondering if you could help me here... modelTwitter is a folder and basically it has lots of different boolvalues and stringvalues etc. in it - I encode the values and put them in a table to save and only use one datastore request. The problem is, for some reason it doesn't always save and doesn't error :(
Any ideas why? It usually works but is not consistent enough to use at the moment!
Thanks!
for _, child in pairs(modelTwitter:GetChildren()) do
for _, saved in pairs(utility:JSONDecode(tab)) do
if rawequal(saved.Name, child.Name) then
child.Value = saved.Value
end
end
child.Changed:connect(function(property)
local tab = {}
for _, v in pairs(child.Parent:GetChildren()) do
tab[#tab + 1] = {Name = v.Name, Value = v.Value}
end
local encoded = utility:JSONEncode(tab)
dataStore:SetAsync(player.userId, encoded)
end)
end
PS: I am also trying to get a version that saves OnPlayerRemoving so I can save the folder either when they leave or onChanged depending on the data! If anyone can help me fix this one and help with an OnPlayerRemoving one I would be really grateful :)
