It prints that the leaderboard has been updated, but nothing shows up on the part, there are no errors that are printed.
local DS = game:GetService("DataStoreService")
local DataStore = DS:GetOrderedDataStore("Donate")
local function SetLeaderboard()
local yes, no = pcall(function()
local data = DataStore:GetSortedAsync(false, 5)
local page = data:GetCurrentPage()
for rank, data in ipairs(page) do
local Name = game.Players:GetPlayerByUserId(tonumber(data.key))
local Robux = data.Value
local onLeaderboard = false
for _, v in pairs(game.Workspace.Leaderboard.SurfaceGui.Display:GetChildren()) do
if v.Player.Text == Name then
onLeaderboard = true
break
end
end
if Robux and not onLeaderboard then
local Frame = game.ReplicatedStorage.Template:Clone()
Frame.Name.Text = Name
Frame.Amount.Text = Robux
Frame.Place.Text = "#"..rank
Frame.Position = UDim2.new(0,0,0.1 * #game.Workspace.Leaderboard.SurfaceGui.Display:GetChildren(),0)
Frame.Parent = game.Workspace.Leaderboard.SurfaceGui.Display
end
end
end)
if not yes then
warn(no)
end
end
while true do
for _, v in pairs(game.Players:GetPlayers()) do
if v.Robux.Value > 0 then
DataStore:SetAsync(v.UserId,v.Robux.Value)
end
end
for _, v in pairs(game.Workspace.Leaderboard.SurfaceGui.Display:GetChildren()) do
v:Destroy()
end
SetLeaderboard()
print("Updated Leaderboard")
wait(60)
end