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

How do you fix this error "Request Was Throttled.Try Sending Fewer Requests."?

Asked by 5 years ago

This is the LocalScript

xpChanger.OnClientEvent:Connect(function(xpGiven)
    -- Save xp
    local curXp,curLvl = saveReturn:InvokeServer(xpGiven)
    -- Math
    local percentage = curXp/(10*curXp)
    local newXOffset = percentage*xOffsetXp
    -- Apply
    xpDisplay:TweenSize(UDim2.new(xScaleXp,newXOffset,xScaleXp,xOffsetXp),'Out','Quad',.5,false,nil)
    lvl.Text = 'Lvl: '..tostring(curLvl)
    xp.Text = 'Xp: '..tostring(curXp)
end)

This is the Script

local bool,message = pcall(function()
    saveReturn.OnServerInvoke = function(plr,xpGiven)
        local key = 'Player-'..plr.userId
        local curLvl = lvlDataStore:GetAsync(key)
        local lvlEquation = 10*curLvl
        -- Adds lvls and sets xp
        if curLvl == 0 and xpGiven == 10 then
            xpDataStore:SetAsync(key,(xpGiven - lvlEquation))
            lvlDataStore:SetAsync(key,(curLvl+1))
            print(curLvl+1)
            return xpDataStore:GetAsync(key),lvlDataStore:GetAsync(key)
        elseif lvlEquation == xpGiven then
            xpDataStore:SetAsync(key,(xpGiven - lvlEquation))
            lvlDataStore:SetAsync(key,(curLvl+1))
            print(curLvl+1)
            return xpDataStore:GetAsync(key),lvlDataStore:GetAsync(key)
        elseif curLvl == maxLvl then
            xpDataStore:SetAsync(key,(0))
            return xpDataStore:GetAsync(key),lvlDataStore:GetAsync(key)
        else
            xpDataStore:SetAsync(key,(xpGiven))
            return xpDataStore:GetAsync(key),lvlDataStore:GetAsync(key)
        end
    end
end)
0
Look at how many times you're sending requests. There should be a 6 second cool down between requests User#19524 175 — 5y
0
I made it immediately RichCookieGamer 7 — 5y
0
It says "Try Sending Fewer Requests." sooooooo you need to Try Sending Fewer Requests. http://robloxdev.com/articles/Data-store limitations are shown on this page INOOBE_YT 387 — 5y

Answer this question