Painful period

so I’m 13 and my periods are horrible. I have to miss school every period and I can’t sleep. Heating pads don’t work and ibuprofen stopped working. My dr didn’t do anything about it so I was thinking of going on the pill but I’m scared to gain weight and I’m scared for my mental health because my mental health is already 💩. I’ve tried every medicine and nothing’s working. Pls help