Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Datastore throwing error; being throttled on the first request / Not saving?

I'm currently testing a game I'm working on. Loading and saving USED TO work fine. I have a script to save, that will try 3 times in a pcall, and it it fails then it will give up. For whatever reason, now I get "Request was throttled. Try sending fewer requests. Key = {}". If this literally is the case, what the actual heck? I get 60 + numPlayers * 10 Gets and sets don't I? EDIT: The Values that load are of the same as when it used to work.

local tries = 0
local success = false
repeat
	tries = tries + 1
	wait(3)
	--success = pcall(function()
		ds:SetAsync(rawData, p.UserId)
	--end)
until success or tries == 3

At this point I have no idea why this is happening. I'm ripping my hair out.. While writing this, I decided to try and send a singlular request to save. No output, it doesn't save either. If it will help, this is how I compress my data.

Saving:

local rawData = {pl.Tix.Value, pl.Rebirth.Value}

Loading:

if rawData ~= nil then
	Tix.Value = rawData[1]
	Rebirth.Value = rawData[2]
end

2 comments

0

Each key can be set once every 6 seconds iirc

0

That doesnt explain how it's not saving then. If it were working, It should load and save. Even using a singular request doesn't throw an error, but doesnt save.

1 answer

✓ Accepted answer

Are you trying this in online mode? Datastores will only save if they have access to API Services, which studio does not have by default.

You also have your SetAsync backwards. You're trying to set rawData to p.UserId.

It should be:

ds:SetAsync(p.UserId, rawData)

You didn't post when you use GetAsync, but I recomend checking that and making sure it matches up to this wiki API page

Here's for your information:

ROBLOX Wiki: SetAsync

2 comments

0

Ah. I had the argument the wrong way. Odd, I dont remember changing it.

0

Probably when I re-writ to accomodate errors and retrys.

This discussion is preserved as it was. New answers, comments, and votes are closed.