local DataStore = game:GetService("DataStoreService") local AS = DataStore:GetDataStore("AS") game.Players.PlayerAdded:connect(function(player) local PA = player.PlayerGui:WaitForChild("Main") local PB = PA:WaitForChild("AttributesFrame") local PC = PB:WaitForChild("UpgradePoints") local points = PC points.Value = AS:GetAsync(player.UserId) or 0 -- gives error 502: API Services rejected request with error: HTTP 0 (HTTP 403 (HTTP/1.1 403 Forbidden)) AS:SetAsync(player.UserId, points.Value) points.Changed:connect(function() AS:SetAsync(player.UserId, points.Value) end) print(points.Value) end) game.Players.PlayerRemoving:connect(function(player) AS:SetAsync(player.UserId, player.points.Value) end)
error: 502: API Services rejected request with error: HTTP 0 (HTTP 403 (HTTP/1.1 403 Forbidden))
I don't have any idea what is wrong, I used almost the same code somewhere else and it worked there