my attributes wont save it will print the right number but it does get past the checking when the player joins, so when it says if ------ and data[“Progress2”] then it won’t get past that
when the player joins
player.Values.CurrentQuest1:SetAttribute("Progress1", 0)
player.Values.CurrentQuest2:SetAttribute("Progress2", 0)
player.Values.CurrentQuest3:SetAttribute("Progress3", 0)
for name, value in pairs(valuesTable) do
if name == "CurrentQuest1" then
if success and data and data["Progress1"] then
player.Values.CurrentQuest1:SetAttribute("Progress1", data["Progress1"])
end
elseif name == "CurrentQuest2" then
print("3")
if success and data and data["Progress2"] then
print(data["Progress2"])
player.Values.CurrentQuest2:SetAttribute("Progress2", data["Progress2"])
end
elseif name == "CurrentQuest3" then
if success and data and data["Progress3"] then
player.Values.CurrentQuest3:SetAttribute("Progress3", data["Progress3"])
end
end
end
when he leaves
function attributesToTable(valuesFolder)
local tbl = {}
for i, intValue in pairs(valuesFolder:GetChildren()) do
if intValue.Name == "CurrentQuest1" then
tbl["Progress1"] = intValue:GetAttribute("Progress1")
elseif intValue.Name == "CurrentQuest2" then
tbl["Progress2"] = intValue:GetAttribute("Progress2")
elseif intValue.Name == "CurrentQuest3" then
tbl["Progress3"] = intValue:GetAttribute("Progress3")
end
end
return tbl
end
local dataToSave = dataToTable(leaderstatsToTable(leaderstatsFolder),valuesToTable(valuesFolder),attributesToTable(attributesFolder)
some off the leaderstats stuuf is in the script to but thats not the problem