Player does not contain any children and cant be indexed. cannot properly save data

recently ive been developing a game and today i came across this issue where data cant be saved because of an issue in which player object cannot be indexed at all. using the :getchildren() method leads to an empty table. this is despite the fact that player is still returned as a valid argument, and that it is the type userdata.

the most odd thing was that yesterday the same script was working, and i used the same format for other games and they all have the same issue today which is affecting datastores. please fix it asap.

local function save(player)
	local success, pdata
	local kills = player.leaderstats.Kills

	repeat 
		reqbudgetwait(Enum.DataStoreRequestType.SetIncrementAsync)
		success, pdata = pcall(function()
			database:UpdateAsync(player.UserId, function()
				local newData

				newData = {
					["Kills"] = kills.Value,
				}
				
				return newData
			end)	
		end)
	until success 
	
	
	repeat 
		reqbudgetwait(Enum.DataStoreRequestType.SetIncrementAsync)
		success, pdata = pcall(function()
			database2:UpdateAsync(player.UserId, function()
				local data = {}
				local bodycolors = player.BodyColors 

				for _, property in ipairs(properties) do
					local color = bodycolors[property]
					if color then
						data[property] = {color.R ,color.G, color.B}
					end
				end

				return data
			end)	
		end)
	until success
end

Players.PlayerAdded:Connect(setup)
Players.PlayerRemoving:Connect(function(player)
	print("e")
	save(player)
end)

local function ServerShutdown()
	for i, player in ipairs(Players:GetPlayers()) do
		print("g")
		save(player)
	end
end

game 1:
image
image

game2:


empty table when children printed.

This is likely a result of this update:

Take a read and update your game’s scripts accordingly. Alternatively, you can disable the behavior via the property.

P.S. In future, make sure you choose the correct sub-category for your bug. This isn’t a Cloud Services Bug, it’d be more of an Engine Bug

2 Likes

wasnt aware of this, thank you!

2 Likes

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