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

I discovered a new error and how do i fix this?

Asked by 4 years ago

502: API Services rejected request with error. HTTP unknown error (HttpError: Timedout)

local PrestigeODS = game:GetService("DataStoreService"):GetOrderedDataStore("Prestige")

local function Handler()
    local Success, Err = pcall(function()
        local Data = PrestigeODS:GetSortedAsync(false, 15)
        local PrestigePage = Data:GetCurrentPage()
        for Rank, Data in ipairs(PrestigePage) do
            local Name = Data.key
            local Prestige = Data.value
            local NewObj = game.ReplicatedStorage:WaitForChild("lbFrame"):Clone()
            NewObj.Player.Text = Name
            NewObj.TotalWheat.Text = Prestige
            NewObj.Rank.Text = "#"..Rank
            NewObj.Position = UDim2.new(0, 0, NewObj.Position.Y.Scale + (0.08 * #game.Workspace.Leaderboards.PrestigeLeaderboard.lbGUI.Holder:GetChildren()), 0)
            NewObj.Parent = game.Workspace.Leaderboards.PrestigeLeaderboard.lbGUI.Holder
        end
    end)
    if not Success then
        error(Err)
    end
end

while true do
    for _,Player in pairs(game.Players:GetPlayers()) do
        PrestigeODS:SetAsync(Player.Name, Player.leaderstats.Prestiges.Value)
    end
    for _,v in pairs(game.Workspace.Leaderboards.PrestigeLeaderboard.lbGUI.Holder:GetChildren()) do
        if v.Name == "lbFrame" then
            v:Destroy()
        end
    end
    Handler()
    wait(20)
end
1
Your api services are on for your game right? greatneil80 2647 — 4y
2
if your api services are on, it's most likely that your connection to roblox studio is bad. krowten024nabrU 463 — 4y
1
yes my api services are on @greatniel80 stevenfury91 -17 — 4y
0
Does this happen in game as well? 4D_X 118 — 4y

Answer this question