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

DataStore: IncrementAsync request throttled?

Asked by
Macbane 46
6 years ago

sp.Touched:connect(function(hit)

local humanoid = hit.Parent:findFirstChild("Humanoid")

if humanoid then
    local character = hit.Parent
    local player = game.Players:GetPlayerFromCharacter(character)
    local key = tostring(player.UserId)
    local moneyData = DataStoreService:GetDataStore("Money",key)
    local money = moneyData:GetAsync(key)
    if money == nil then
        moneyData:SetAsync(key,0)
    end

    if throttle then
        throttle = false
        moneyData:IncrementAsync(key,1)
        money = moneyData:GetAsync(key)
        print(money)
        wait(1)
        throttle = true

    end
end

end)

It says in yellow " Request was throttled. Try sending fewer requests. Key = 187286943"

I'm only using IncrementAsync at a maximum of 1 per second? What does the request throttled mean and should it be any concern since everything still works.

1 answer

Log in to vote
0
Answered by
Amiaa16 3227 Moderation Voter Community Moderator
6 years ago

All write requests (SetAsync, IncrementAsync, UpdateAsync, RemoveAsync) have a limit of using the same key once per 6 seconds aside from the global DataStore limit of 60 + players amount * 10 per minute.

Thus you should make your debounce last 6 seconds at least.

Read more about it here.

Ad

Answer this question