making a global leaderboard Gui?
Asked by
4 years ago Edited 4 years ago
So ive been looking to make a global leaderboard Gui and all i can find i is these wall leaderboards, Anyone know how to make it for a Gui?
--Edit-- So ive tried to make just a normal leaderboard on a brick but i keep getting " DataStore request was added to queue. If request queue fills, further requests will be dropped. Try sending fewer requests.Key = 281762843" no matter how much time i give it (currently 10 sec tried up to 90) it will not drop the warning. heres the code if u would need it
01 | local DataStoreService = game:GetService( "DataStoreService" ) |
02 | local TimeODS = DataStoreService:GetOrderedDataStore( "AdminSaveStore" ) |
05 | local timeUntilReset = 10 |
11 | timeUntilReset = timeUntilReset - 1 |
13 | script.Parent.Parent.Countdown.Text = timeUntilReset |
16 | if timeUntilReset = = 0 then |
21 | for i, plr in pairs (game.Players:GetPlayers()) do |
23 | TimeODS:SetAsync(plr.UserId, plr.leaderstats.Minutes.Value) |
26 | for i, leaderboardRank in pairs (script.Parent:GetChildren()) do |
28 | if leaderboardRank.ClassName = = "Frame" then |
29 | leaderboardRank:Destroy() |
34 | local success, errorMsg = pcall ( function () |
36 | local data = TimeODS:GetSortedAsync( false , 5 ) |
37 | local coinsPage = data:GetCurrentPage() |
39 | for rankInLB, dataStored in ipairs (coinsPage) do |
42 | local name = game.Players:GetNameFromUserIdAsync( tonumber (dataStored.key)) |
43 | local coins = dataStored.value |
46 | local template = script.Template:Clone() |
48 | template.Name = name .. "Leaderboard" |
50 | template.PlrName.Text = name |
52 | template.Rank.Text = "#" .. rankInLB |
54 | template.Minutes.Text = coins |
56 | template.Parent = script.Parent |