Restraining orders

In the event that a custody hearing is set; both parties appear in court, judge sets everything in writting, can my granddaughter ask for a restraining order against her ex? The ex and his friends are constantly harassing her. She has become emotionally exhausted over this. The verbal conduct being said that I, myself have read, would do the same to me.
Her name is being painted badly.

If he has threatened to harm her physically she may apply for a domestic violence protective order, otherwise, I would suggest she report verbal harassment to the police and hope that they will advise him to stop.

She has gone to the police and they have stated to her that there is nothing they can do.

Oh, but there is. Perhaps not with the police though. Depending on the evidence that she has, she may have grounds for a lawsuit based on harassment, intentional infliction of emotional distress, etc. Those are probably beyond the scope of this forum, but I would encourage her to seek counsel from an attorney who may be able to help her stop this behavior.