I have a slight working data store script but it keeps throttling my stores and i dont know how to fix it, here is my script
local DataStore = game:GetService("DataStoreService")
local ds = DataStore:GetDataStore("CashSaveSystem")
game.Players.PlayerAdded:connect(function(player)
local leader = Instance.new("Folder",player)
leader.Name = "leaderstats"
local Spins = Instance.new("IntValue",leader)
Spins.Name = "Spins"
Spins.Value = ds:GetAsync(player.UserId) or 0
ds:SetAsync(player.UserId, Spins.Value)
Spins.Changed:connect(function()
ds:SetAsync(player.UserId, Spins.Value)
end)
end)
game.Players.PlayerRemoving:connect(function(player)
ds:SetAsync(player.UserId, player.leaderstats.Spins.Value)
end)
I'm making a simulator game with rapid clicking so it's getting a lot of requests and it's causing it to not save anything. Any help would be appreciated :P

1 comment
Add a Debounce