Confused

I don’t understand how guys think it’s ok to lead you on and then when your all caught up in feelings they decide to break your heart and say that they don’t want to be more then friends.