I've got this error 100% of the times tried, and i have done some researches about it, im looking for a solution
Place is owned by a friend, and i'm on team create. (I need a solution, please.)
DataStore:
local DataStore = game:GetService("DataStoreService"):GetDataStore("a")
local PlayerStatistics = script.PlayerStatistics
local SavingInterval = (150)
--\\--
local GamepassModule = require(game:GetService("ReplicatedStorage"):WaitForChild('Modules')["Gamepasses"])
local ExtraBankAmount = ('300000')
local ExtraWalletAmount = ('10000')
--\\--
game.Players.PlayerAdded:Connect(function(Player)
local GetSaved = DataStore:GetAsync("Id - "..Player.UserId)
local DataArchive = PlayerStatistics:Clone()
DataArchive.Parent = workspace:WaitForChild("Data")
DataArchive.Name = Player.UserId
if GetSaved then
for i, Stats in pairs(script.PlayerStatistics:GetChildren()) do
DataArchive[Stats.Name].Value = GetSaved[i]
end
else
local StatsToSave = {}
for i, Stats in pairs(DataArchive:GetChildren()) do
table.insert(StatsToSave, Stats.Value)
end
DataStore:SetAsync("Id - "..Player.UserId, StatsToSave)
end
while wait(SavingInterval) do
local StatsToSave = {}
for i, Stats in pairs(DataArchive:GetChildren()) do
table.insert(StatsToSave, Stats.Value)
end
DataStore:SetAsync("Id - "..Player.UserId, StatsToSave)
end
game.Players.PlayerRemoving:connect(function(Player)
local StatsToSave = {}
for i, Stats in pairs(DataArchive:GetChildren()) do
table.insert(StatsToSave, Stats.Value)
end
DataStore:SetAsync("Id - "..Player.UserId, StatsToSave)
end)
end)
Thanks.

6 comments
Is API enabled.?
Yes.
No it isn’t, 403, API Service isn’t enabled, look it up in the error logs for DSs
502 is like a Bad Request, try again later, though I am not an expert with that so I’ll leave it for someone else
API Is enabled, i wouldn't have said it wasn't if it weren't.
This doesn't look equipped to deal with DataStore limits, you should try DataStore2 for a datastore module. https://devforum.roblox.com/t/how-to-use-datastore2-data-store-caching-and-data-loss-prevention/136317