DataStore problems (Again)

So, I got better with datastore management but this error is new for me, problem is happening whenever the player leaves the place so I’ll cut the script out for you.

Output:
502: API Services rejected request with error. HTTP 403

Script:


game.Players.PlayerRemoving:Connect(function(player)
	
	local success, fail = pcall(function()
		
		local playerdata = game.Players[player.Name].PlayerData
		local gold = playerdata.Gold
		local level = playerdata.Level
		
		currentstore:SetAsync(tostring(player.UserId), {gold.Value, level.Value})
		
	end)
	
	if success then
		
		warn('Player has left but his data was saved')
		
	else
		
		warn('Player has left but his data DIDNT save')
		print(fail)
	end
end)
2 Likes

is your game enabled with api services?
(sorry for bad english.)

Yes, the API services are enabled, I should’ve mentioned that in my post.

i recommend to you to use Datastore2