Hey, so I wanted to make a global leaderboard for my game, but I’ve ran into an issue while testing. For some reason, the ipairs loop stops looping through all contents of pages when I have a humanoid:ApplyDescriptionReset()
Code:
local data = orderedDataStore:GetSortedAsync(false, 100)
local page = data:GetCurrentPage()
print(#page)
for rank, savedData in ipairs(page) do
local userId = tonumber(string.match(savedData.key, "^%d+"))
local name = Players:GetNameFromUserIdAsync(userId)
local value = savedData.value
local podium = leaderboard:FindFirstChild("Podium"..rank)
local description = Players:GetHumanoidDescriptionFromUserId(userId)
print(rank)
if podium then
local statue = podium:FindFirstChild("Statue")
local humanoid = statue:FindFirstChild("Humanoid")
--humanoid:ApplyDescriptionReset(description) Code that breaks script
local displayName = statue:FindFirstChild("Head"):FindFirstChild("DisplayName")
local textLabel = displayName:FindFirstChild("Name")
textLabel.Text = name
end
end
-- All code not displayed here
I tried changing it to just regular ApplyDescription, it didn’t change the outcome. I need this line of code so that the players outfit can load onto the podium. Maybe there is a better way to do this? Please let me know!