Rock band No Vacancy performs at a nightclub three weeks before auditioning for a Battle of the Bands competition. Guitarist Dewey Finn engages in on-stage antics, including a failed stage dive that abruptly ends the performance. The next morning, Dewey wakes up in the apartment he lives in with his friend, Ned Schneebly, and Ned's girlfriend, Patty Di Marco. They inform Dewey that he is overdue on his share of the rent, and that he must make up for it within one week or move out. When Dewey meets No Vacancy at a rehearsal session, he finds out that he has been replaced by another guitarist named Spider. Later, while attempting to sell some of his equipment for rent money, Dewey answers a phone call from Rosalie Mullins, the principal of the Horace Green prep school, inquiring for Ned about a short-term position as a substitute teacher. Desperate for his rent money, Dewey impersonates Ned and gets the position. On his first day at school, "Mr. S" (the name Dewey adopts when realizing he doesn't know how to spell Schneebly) behaves erratically, much to the class' confusion.