i get this error : 11:45:57.468 - 502: API Services rejected request with error: HTTP 0 (HTTP 403 (HTTP/1.1 403 Forbidden))
every time i execute this code and i do have api on and filtering enabled on
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 Cash = Instance.new("IntValue",leader)
Cash.Name = "Miner Bucks"
Cash.Value = ds:GetAsync(player.UserId) or 0
ds:SetAsync(player.UserId, Cash.Value)
Cash.Changed:connect(function()
ds:SetAsync(player.UserId, Cash.Value)
end)
end)
game.Players.PlayerRemoving:connect(function(player)
ds:SetAsync(player.UserId, player.leaderstats.Cash.Value)
end)

2 comments
Do you own the place?
connect and the parent argument to Instance.new are deprecated. Switch to Connect and assign the parent last instead of first, assigning first can down the performance.