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

Request was throttled? Help please? [SOLVED MYSELF]

Asked by 2 years ago
Edited 2 years ago

So, I have a clicker clicking at 0.1s speed and a datastore is saving a value, but after about 20 clicks it starts coming up with an error and stops saving the value. Help please?

function newData(statType,startingAmt,datastore,Name,Parent,player)
    local test = Instance.new(statType,Parent)
    test.Name = Name
    test.Value = datastore:GetAsync(player.UserId) or startingAmt
    datastore:SetAsync(player.UserId, test.Value)
    test.Changed:Connect(function()
        datastore:SetAsync(player.UserId, test.Value)
    end)

    game.Players.PlayerRemoving:Connect(function(player)
        datastore:SetAsync(player.UserId, player.stats[Name].Value)
    end)
end
2
This is because you are sending too many requests to the datastore server. This is to prevent the data store server from crashing due to too many requests.. th3_broz 32 — 2y

2 answers

Log in to vote
1
Answered by 2 years ago

Use Debounce Bruh

0
Still not working SharkOwen_dev 69 — 2y
0
Also can you atleast show an example? SharkOwen_dev 69 — 2y
Ad
Log in to vote
0
Answered by 2 years ago

I figured it out myself.

I moved the PlayerRemoving function to the end of the script and switched the datastores to the datastores that are being saved.

Same with the Value of what i'm saving.

Answer this question