Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

making a global leaderboard Gui?

Asked by 3 years ago
Edited 3 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

local DataStoreService = game:GetService("DataStoreService")
local TimeODS = DataStoreService:GetOrderedDataStore("AdminSaveStore")


local timeUntilReset = 10


while wait(1) do


    timeUntilReset = timeUntilReset - 1

    script.Parent.Parent.Countdown.Text = timeUntilReset


    if timeUntilReset == 0 then

        timeUntilReset = 10


        for i, plr in pairs(game.Players:GetPlayers()) do

            TimeODS:SetAsync(plr.UserId, plr.leaderstats.Minutes.Value)
        end

        for i, leaderboardRank in pairs(script.Parent:GetChildren()) do

            if leaderboardRank.ClassName == "Frame" then
                leaderboardRank:Destroy()
            end
        end


        local success, errorMsg = pcall(function()

            local data = TimeODS:GetSortedAsync(false, 5)
            local coinsPage = data:GetCurrentPage()

            for rankInLB, dataStored in ipairs(coinsPage) do


                local name = game.Players:GetNameFromUserIdAsync(tonumber(dataStored.key))
                local coins = dataStored.value


                local template = script.Template:Clone()

                template.Name = name .. "Leaderboard"

                template.PlrName.Text = name

                template.Rank.Text = "#" .. rankInLB

                template.Minutes.Text = coins

                template.Parent = script.Parent             
            end         
        end)
    end
end

0
Chances are the wall leaderboards use a surface gui, which, is pretty much a ScreenGui. RazzyPlayz 497 — 3y

2 answers

Log in to vote
0
Answered by
NGC4637 602 Moderation Voter
3 years ago

You can do the same thing they do on the walls, but a screengui instead of surface gui.

0
and place in startergui instead of a part. also make an open and close button for said leaderboard gui if you dont want it to annoy people NGC4637 602 — 3y
0
i did thisit wont update Pitched_mobile 191 — 3y
Ad
Log in to vote
0
Answered by 3 years ago

Alright so theres no issue with my script but with the database fetch so ill make a better question

Answer this question