So I have a datastore here is my code:
local DataStore = game:GetService("DataStoreService")
local Ds = DataStore:GetDataStore("PlayerValueSave")
game.Players.PlayerAdded:Connect(function(player)
local stats = Instance.new("IntValue", player)
stats.Name = "leaderstats"
local Money = Instance.new("IntValue", stats)
Money.Name = "Money"
Money.Value = Ds:GetAsync(player.UserId) or 100
local Role = Instance.new("StringValue", stats)
Role.Name = "Rank"
Role.Value = "Owner"
Ds:SetAsync(player.UserId, Money.Value)
Money.Changed:Connect(function()
Ds:SetAsync(player.UserId, Money.Value)
end)
end)
game.Players.PlayerRemoving:Connect(function(player)
Ds:SetAsync(player.UserId, player.leaderstats.Money.Value)
end)
game.Workspace.Baseplate.BrickColor = BrickColor.Black()
I have a textbutton that has a localscript, that is changing the players value of their money by using RemoteEvents to do so.
But I am getting this odd error, "Request was Throttled, try sending fewer requests" and SetAsync request was dropped. Request was Throttled, but throttled request queue was full.
The SetAsync error is revolving around Line 18. The first error (Try sending fewer requests) doesn't specify a line. It's the orangish text.

4 comments
The Datastore doesnt work in studio Try it ingame
"facepalm", I am doing it in-game. Of course, I'm not that non intelligent to know that it won't work in studio. To put it simple, yes I have tested it on my own game. But I have opened my developer console in game aswell and I have gone to the server log to find and discover those errors.
Maybe try to make stats with their own save? i usually go with scriptsavemoney , scriptsaveXP , scriptsavelevel Its probably cuz it can only allow one stat to be saved? i dunno but try to set 1 stat for each save? try it i dont know i am new to lua thingy
I'm only saving one stat, and that's the Money interger value. :P