Waiting System not working

So I’m trying to make a system to make sure every joins the game before it starts but it seems to not be able to get the teleport table and just returns a hash with no errors, what have I done wrong:

Players.PlayerAdded:Connect(function(player)
	if gameStarted then
		player:Kick("Game already started, please join the next game.")
		return
	end

	if maxPlayers == nil then
		local joinData = player:GetJoinData()
		if joinData then
			print(joinData.TeleportData)
		end
		maxPlayers = player:GetJoinData().MaxPlayers
	end

	playersJoined = playersJoined + 1
	updateAllPlayersUI()  

	if playersJoined == 1 then
		task.wait(waitingTime)

		if playersJoined < maxPlayers then
			hideAllPlayersUI()
		else
			gameStarted = true
		end
	end
end)

You initialise local joinData = player:GetJoinData() and still go on to use player:GetJoinData().MaxPlayers in the same scope as your already scoped joinData.

That is beside the point. I can’t see any reference to MaxPlayers in the JoinData dictionary in the help documentation:

Player | Documentation - Roblox Creator Hub