The scrotum pain and right upper abdominal pain can be related when considering a kidney stone...or urinary tract infection included kidney infection.
Other possible causes of acute right upper abdominal are gall bladder disease (including acute inflamation), liver disease, lower right lung inflamation or infection, colon issues, and stomach problems.
With numerous potential causes, it is important to have a physician evaluate you.
Is there any nausea or vomiting, any cough, any fever? Any constipation or diarrhea? Does the pain improve or worsen with food or fluid intake...or after having a bowel movement.
Related to the first point, does it hurt to pee?
Again, seek medical attention.
Let us know how things turn out.
Tom Plamondon PA-C, PT