It could be your appendix, or something you ate, or anything. Not having much to do with the masturbation three months ago. Just describe to them your symptoms and see if they think you should see a doctor. There is no reason to tell them you masturbated 3 months ago, you did not harm yourself doing that and the pain in your tummy is not from that.
Hi if you are in that much pain Please tell your parents so they can sort it out for you , take care