You can write your topic however you want, but you need to answer these questions:
- What do you want to achieve? Keep it simple and clear!
I am trying to load Data
- What is the issue? Include screenshots / videos if possible!
All bool values turns “True” after joining back even if they shouldn’t
as you can see from output
at line 316 it prints player’s saved data
some values are false some are true
but at line 320
all values turns to true
and this is the “v” which is line 317
as you can see
bool values Named “Melok”,“TestStuff” are false both in print(y.Value) and print(v)
but after line 319 which is y.Value = v
this bool values are turning “true”
if you would like to see whole code of loading
if success then
if returnValue then -- if player Has Data
warn(returnValue)
-- Iterate datastore table and populate stuff in player
for k, d in pairs(returnValue) do
if k == "RewardsTable" then
print("TestStuff21")
Players_Rewards[player.UserId] = d
else
if type(d) == "table" then -- if table then
for n, v in pairs(d) do
print(d)
warn(k,n,v)
if player[k][n]:IsA("Folder") then -- Is a Folder
print(player[k])
print(player[k][n])
for t,y in pairs(player[k][n]:GetChildren()) do
print(d,d.Value)
print(y,y.Value)
print(v,v.Value)
print(t)
y.Value = v
print(y,y.Value)
end
else -- is a Value
print(player[k][n])
player[k][n].Value = v
print(v)
warn(k,n,v)
end
end
end
end
end
print(returnValue)
print(returnValue)
and what is ReturnValue:
local dataTable = {
["leaderstats"] = {
Strength = strength,
KillStreak = killStreak,
},
["Inventory"] = {
EquippedTool = equippedTool,
OwnedTools = ownedToolsTable,
EquippedRank = equippedRank,
OwnedRanks = ownedRanksTable,
EquippedDNA = equippedDNA,
OwnedDNAs = ownedDNAsTable,
OwnedGamePasses = ownedGamePassesTable,
AchivementsV1 = OwnedAchivementsTable
},
["Values"] = {
Coins = coins,
TotalStrength = TotalStrength,
TotalCoins = TotalCoins,
DailyReward = dailyReward,
ZoneLevel = zoneLevel
},
["RewardsTable"] = Players_Rewards[player.UserId]
}
--print(dataTable)
local success, returnValue
repeat
waitForRequestBudget(Enum.DataStoreRequestType.UpdateAsync)
success, returnValue = pcall(dataStore.UpdateAsync,dataStore,key,function()
print(dataTable)
return dataTable
end)
until success