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

Global LeaderBoard Not working?

Asked by 9 years ago

So basically, ive been trying to get my leaderboard to work and save, however, there seems to be this annoying error ive never seen before:


Stat = "Lvl" local ods = game:GetService("DataStoreService"):GetOrderedDataStore(Stat) function updateBoard(board, data) for k,v in pairs(data) do local pos = k local name = v.key local score = v.value local nametextbox = board.SurfaceGui:FindFirstChild("Name" .. pos) nametextbox.Text = name local scoretextbox = board.SurfaceGui:FindFirstChild("Score" .. pos) scoretextbox.Text = score end end while true do wait(3) local pages = ods:GetSortedAsync(false, 5) -- Here local data = pages:GetCurrentPage() updateBoard(game.Workspace.Top5ScoreBoard, data) end

oh and if youre wondering here is the other script that goes with it:


Stat = "Lvl" DS = game:GetService("DataStoreService"):GetOrderedDataStore(Stat) while true do wait(3) for i,p in pairs(game.Players:GetPlayers()) do cash = p:WaitForChild("leaderstats").Lvl DS:UpdateAsync(p.Name, function() local new = cash.Value or 0 print(new) end) end end

The error (which ive noted above ^) shows this in the error: HTTP 429 (HTTP1.1 429 ProvisionedThroughputExceeded); as well as spamming: "This Function is not enabled yet!" without saying what function it is, (but im guessing its that one) ive tryed some research but could'nt find anything. Thanks for the help, ~ bubs

1
429 HTTP response code means "Too many requests" and seeing you are updating in an infinite loop maybe that's the problem. Does it update the first seconds? If so then consider using DataStore:OnUpdate callback instead Destrings 406 — 9y
1
Yeah, that seems to be the problem, GetSortedAsync can only be called 5 + numPlayers * 2 times per minute Destrings 406 — 9y
0
thanks very much!, however the DataStore:OnUpdate you mentioned, do i replace the 'true' in a while script with that?, also this does not seem to update my scoreboard, but thanks anyways! Bubbles5610 217 — 9y

Answer this question