This piece of code from a big block seems to be the problem. It doesn't print out "Save 2"
local function SaveData(player)
if player.userId < 0 then return end
player:WaitForChild("leaderstats")
wait()
local leaderstats = {}
for i, stat in pairs(player.leaderstats:GetChildren()) do
if not stat:IsA("Folder") then
print("Save 1")
table.insert(leaderstats, {stat.Name, stat.Value})
end
end
player:WaitForChild("leaderstats"):WaitForChild("Rebirth")
wait()
for i, stat in pairs(player.leaderstats.Rebirths:GetChildren()) do
print("Save 2")
table.insert(leaderstats, {stat.Name, stat.Value})
end
leaderboardData:SetAsync(player.userId, leaderstats)
Print("Saved "..player.Name.."'s data")
end
leaderstats folder: https://drive.google.com/file/d/1j1v2ZnDaCvP1ifK-H1XgtWIJffGFppzW/view?usp=sharing

8 comments
I can't see the file. 'Access denied'
oh
it should work now
Is there any errors? it seems that it should work.
no errors
but it doesnt work
did you run the function? can you give the script where you run it?
oh, and enable studio acces to api service in game settings. Did you enable it yet?