Ex being a horrible prick!

I'm sorry for this being long but please comment your thoughts.
My ex and I broke up exactly a week ago and we still have feelings for each other but it kind of ended over a fight. He found out that I was talking to one of my old guy friends during the week and we just went on a walk to clear my head and talked about everything. And my ex went crazy, he texted me saying he was going to kill him and that I was dead to him, he thinks I done stuff with him (sexual or whatever). And now he's threatening me even with my nudes (my own fault I know) and I honestly don't know what to do. He cheated on me and went off with a girl the night we broke up but I'm still the bad guy for just talking to my friend who happens to be male. He's being such an ass now, telling me I was never worth it and that he's going to get with a load of girls tonight just to hurt me, and just being such a disrespectful fuck! Please help idk what to do