How can i assign a seat to a player if its not taken?

So im working on a system that checks if a seat is not taken, if its not taken the player will be seated on that seat this is what i came up with

local GameHandler = function()
	local AssignSeats = function()
		for i, Players in pairs(game.Players:GetPlayers()) do
			if Players.Character then
				print(Players.Character)
				for i, Seat in pairs(workspace.Seats:GetChildren()) do
					if Seat.Occupant == nil  then
						local RandomSeat = Seat[math.random(1, #Seat)]
						print(RandomSeat)
					end
				end
			end
		end
	end
	while wait(5) do
		AssignSeats()
	end
end

return GameHandler

Error

ServerScriptService.GameHandler:8: attempt to get length of a Instance value  -  Server - GameHandler:8
  23:40:20.815  Stack Begin  - 

ur doing it all wrong, you are looping through it without having to

local GameHandler = function()
	local AssignSeats = function()
		for i, Players in pairs(game.Players:GetPlayers()) do
			if Players.Character then
				print(Players.Character)
				local Children = workspace.Seats:GetChildren()
				local Picked;
				local Seat;

				repeat wait()
					Seat = Children[math.random(1,#Children)]

					if not Seat.Occupant then
						Picked = true
					end
				until Picked

				print(Seat)
			end
		end
	end
	while wait(5) do
		AssignSeats()
	end
end

return GameHandler