local DataStoreService = game:GetService("DataStoreService")
local ActivityLeaderboard = DataStoreService:GetOrderedDataStore("ActivityLeaderboard")
local function updateLeaderboard()
local success, errorMessage = pcall(function()
local Data = ActivityLeaderboard:GetSortedAsync(false,5)
local ActivityPage = Data:GetCurrentPage()
for rank, data in ipairs(ActivityPage) do
local userName = game.Players:GetNameFromUserIdAsync(tonumber(data.key))
local Name = userName
local Activity = data.Value
local isOnLeaderboard = false
for i,v in pairs(game.Workspace.globalLeaderboard.leaderboardGui.Holder:GetChildren()) do
if v.Player.Text == Name then
isOnLeaderboard = true
break
end
end
if Activity and isOnLeaderboard == false then
local newLBFrame = game.ReplicatedStorage:WaitForChild("LeaderboardFrame"):Clone()
newLBFrame.Player.Text = Name
newLBFrame.Points.Text = Activity
newLBFrame.Rank.Text = "#"..rank
newLBFrame.Position = UDim2.new(0,0,newLBFrame.Position.Y.Scale + (.09 * #game.Workspace.globalLeaderboard.leaderboardGui.Holder:GetChildren()),0)
newLBFrame.Parent = game.Workspace.globalLeaderboard.leaderboardGui.Holder
end
end
end)
if not success then
print(errorMessage)
end
end
while true do
for _, Player in pairs(game.Players:GetPlayers()) do
ActivityLeaderboard:SetAsync(Player.UserId,Player:WaitForChild("leaderstats"):FindFirstChild("Activity").Value)
end
for _,frame in pairs(game.Workspace.globalLeaderboard.leaderboardGui.Holder:GetChildren()) do
frame:Destroy()
end
updateLeaderboard()
wait(10)
end
Well, you could’ve simply searched and found your answer! Here are a few videos and posts I’ve found, feel free to search a bit more. If this does not solve your problem, feel free to reply to this or to DM me.
Try re-reading your code, also try checking the description for the code, sometimes your code might be written wrong. (Make sure to read it afterwards so you can learn) I’ll check your code right now.
Check if the frames are visible or not, maybe the transparency is set to 0.
Edit: TheDevKing also mentions that you have to publish the game, check if your game is published or not, that might be the problem.
As @Coldshot_Dev Said, the script might be outdated, try the one I suggested that’s made by @ThatTimothy, he also has a model so you can check if it works.