Randomly(I didn't even do anything) data store is broken

the error msg is 502: API Services rejected request with error. HTTP 503 (Service Unavailable)
It just randomly happened when I was making my game

My loading data function

local data = {}

local function LoadData(player)
		local key = player.UserId
		local database = DataStore:GetDataStore("playerdata")
		local success = nil
		local errormsg
		local playerData= nil
		local attempt = 1
		print(database)
		repeat
			success, errormsg = pcall(function()
				playerData = database:GetAsync(key)
			end)
			if errormsg then print(errormsg) end
			attempt += 1
			if not success then warn(playerData, " Databro") end
			wait()
		until success or attempt == 3
		if success then
			print("Dataloaded")
			if not playerData then
				print("new player")
				playerData = {
					["Coin"] = 300,
					["Equipped"] = {"Squire", "Spearman"},
					["Owned"] = {"Squire", "Spearman"}
				}
			end
			data[player.UserId] = playerData
			print(playerData)
		else
			warn("noooo load broke")
			player:Kick("ur loading broken")
		end
end

RP.GetData.OnServerInvoke = function(player)
	return data[player.UserId]
end

Ur code looks fine i think something is going on, on roblox’s end

There was a Roblox server outage today resulting in some datastores failing. This problem has been fixed now and all datastores are functioning correctly.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.