Hello!
I am making a datastore that saves a bool value and can load and apply the value of it to a bool value in the player, so it can be used by other scripts. However, whenever it loads the value, it sets it to true, when the actual value (which I print in the console) is false. Does anyone know how I can fix this? Here are the code snippets.
Load Data:
if GetData.indexstats then
for a,b in pairs(GetData.indexstats) do
local FoundValue = indexstats:FindFirstChild(a)
FoundValue.Value = b.Value
print(b.Value)
end
end
Save Data:
table.clear(Data.indexstats)
for _,b in pairs(indexstats:GetChildren()) do
if not b:IsA("BoolValue") then continue end
Data.indexstats[b.Name] = {
Value = b.Value,
}
end