[Datastore Issues] Script seems to be giving a lot of weird Throttle errors

> local Data = game:GetService("DataStoreService"):GetDataStore("BankNWalletDatastore")
> local Players = game:GetService("Players")
> 
> Players.PlayerAdded:Connect(function(plr)
>     local success, err = pcall(function()
>         data = Data:GetAsync("Data_"..plr.UserId) or {}
>     end)
> 
>     if success then
>         local folder = Instance.new("Folder")
>         folder.Name = 'leaderstats'
>         folder.Parent = plr
>         local wallet = Instance.new("IntValue")
>         wallet.Name = "Wallet"
>         wallet.Value = data["Wallet"] or 25000
>         wallet.Parent = folder
>         local bank = Instance.new("IntValue")
>         bank.Name = "Bank"
>         bank.Value = data["Bank"] or 0
>         bank.Parent = folder
> 	end
>     if err then
>         plr:Kick("No data was found. Perhaps this was an error?")
>     end
> end)
> 
> 
> Players.PlayerRemoving:Connect(function(plr)
>     local tosave = {
>         ["Bank"] = plr.leaderstats.Bank.Value,
>         ["Wallet"] = plr.leaderstats.Wallet.Value
>     }
>     local success, err = pcall(function()
>     Data:SetAsync("Data_"..plr.UserId, tosave)
>     end)
>     if success then
>         print("Success!")
>     end
> end)


Continuous flow of errors (same one)

Basically I’m trying to get rid of those errors.

Well the errors seem to happen even though there’s no SetAsync anywhere from Line 1-20 and from what I see it’s a roblox sided error possibly?

Well I tried getting help from a lot of scripting geniuses but I’m not sure how skillful they are but they couldn’t seem to fix it since SetAsync don’t occur anywhere in the script from line 1-20.

From what I see this occurs when the player joins the game? Possibly might be adding some data to the queue when it doesn’t need to be added or set.

1 Like

Have you tried looking into other sources that could cause the requests to be throttled? Perhaps another script could be getting/setting too much.

Well I have a script that gives the player money every 75 seconds but from what I see that wouldn’t be causing it as the script only Set/GetASync when they enter or leave the game.

I tried replicating this in studio via a local studio server with 8 players. I can’t seem to replicate it.

Have other people told you about this error? (if you have used this in a public server)?

Also, are you part of the beta program and have the new Lua VM on? Try turning it off if so.

Does this happen in Client AND Studio? Or just one of the 2

A few things I could come up with, I can’t replicate it myself so hopefully I can try and better replicate the problem with some info

1 Like

This happens in game like in the official game, no I’m not apart of the beta program from what I think the error doesn’t even make sense.

I’m genuinely stumped at this point, I can only assume it’s something wrong on your side, try re-installing roblox maybe? I haven’t got a clue as to what is causing this mysterious problem.