Find a movie

I’ve been trying to find a certain movie for a while now. I watched it a long time ago, so i don’t remember everything clearly.

It’s a high school movie with 2 main characters. The primary protagonist (I’ll call him x) has depression and takes pills. The secondary protagonist (y) also writes plays.

I also remember a scene where y secondry steals the pills from the x’s bag during a party.

There was also a scene where the x showed y’s script to someone and y flipped out on him.

In the end, they end up performing it as a play.

Oh yeah, and y ends up getting shot by some dude after the play.

Geez, what the hell was i even watching. Anyway, I watched this movie a long time ago, so some of the details may be incorrect. Regardless, i would really appreciate it if someone could guess which movie this is.

Thanks

Charlie Bartlett (2007).

Google: movie|film+“high school”+playwright|play+writes|writing|wrote+depression+pills|medication+shot|shoots|shooting

No, it it not, unfortunately.

Are you sure?

“Complications arise when seriously depressed Kip Crombwell (Mark Rendall) attempts suicide by swallowing a handful of anti-depressants provided by Charlie”

“Charlie discovers Kip is writing a play about adolescent issues”

“Charlie finds Mr. Gardner heavily intoxicated and waving a revolver”

Yes, i am sure this is not it.