If a school offers around 30 AP courses, then how many would be good to take for top tier colleges.
Successful candidates to top tier colleges typically have 7-11 AP courses on their transcript if their school offers say 10 to 20 AP courses. If an H.S. only offers 5 AP courses and you take all 5 of them that show you challenged yourself as much as theoretically possible at that HS. Likewise, if an H.S. had no AP courses but had honors courses or had the possibility of dual enrollment, and the student took honors/DE classes, then that would also satisfy course rigor. Since your school has 30 AP courses, I wouldn't suggest taking 20 or 24 of them because that seems overkill and at some point, there is in fact diminishing returns for taking way too many AP courses unless you are a talented and gifted scholar and can get 20-24 As in APs and they represent no big challenge to you. AP is for some elite colleges are a nuisance because they don't adequately replace the same college course nor the experience of learning. And these colleges like Williams, Brown, MIT, CalTech, you will have to repeat all the STEM courses and in some cases all the AP classes because they are not transferable whatsoever. Elite colleges love to see you challenged yourself, but they are selfish and want you to experience taking Calculus or Physics or Biology at their school under their learning system. So at best, it's a necessary evil like standardized tests but it doesn't necessarily reward you by shedding a year off your 4-year commitment. State schools and say T50-T100 school are more generous and some give you full college credit for getting 3s and 4s.
AP's are only one of many components that are considered in your college application so keep that in mind. It's better to have good stats across the board and have excellent ECs and other examples of intellectual accomplishment versus padding your academic resume with a lot of AP classes.
Other CV posters may disagree and think that taking 20 APs is a great idea if you can handle it. I think there are so many things to do well on during high school that you can't put that much emphasis only on taking AP classes. The more elite the college is, the they want to recruit admits that have the potential to change their communities and the world. They want students who have a strong unwavering character, who are also compassionate kind, and selfless. Non-Sibi.