the clone.SizeLabel.Text = tostring(entry.Value) shows nil on the leaderboardeven though ive ordered everything correctly, no tutorial nor chatgpt could help me fix this, any help is appreciated
local playerSize = dataStoreService:GetOrderedDataStore("PlayerSize")
local playerInfo = script:WaitForChild("PlayerInfo")
local playerContainer = script.Parent.SurfaceGui.LeaderboardHolder
game.Players.PlayerRemoving:Connect(function(plr)
local leaderstats = plr:FindFirstChild("leaderstats")
if not leaderstats then return end
local size = leaderstats:FindFirstChild("Size")
if not size then return end
pcall(function()
playerSize:SetAsync(plr.UserId, size.Value)
end)
end)
while true do
task.wait(10)
local success, pages = pcall(function()
return playerSize:GetSortedAsync(false, 100)
end)
if not success then continue end
for rank, entry in ipairs(pages:GetCurrentPage()) do
local clone = playerInfo:Clone()
local ok, username = pcall(function()
return game.Players:GetNameFromUserIdAsync(entry.key)
end)
clone.UsernameLabel.Text = ok and username or "Unknown"
clone.SizeLabel.Text = tostring(entry.Value)
clone.RankLabel.Text = "#" .. rank
clone.Parent = playerContainer
end
end