Daniel Swift sent explicit pictures to the 14-year-old and arranged for her to travel to Lincoln to meet him for sex.
He was caught when those behind the sting detained him and called police.
Swift, 47, of Princess Street, admitted charges of attempting to sexually communicate with a child and attempting to meet a child following grooming.
He was ordered to be detained in a secure psychiatric unit after Lincoln Crown Court heard he had been treated for over 25 years for mental health problems and had been diagnosed as suffering from paranoid schizophrenia.
Richard Thatcher, prosecuting, told the court: "This case arises through the defendant's contact through social media with, as he believed her to be, a 14-year-old girl called Emma.
"She was actually an adult woman who had set up that alter ego on social media," he said.
The court heard he first made contact with 'Emma' in April when she told him her age.
"He began by asking if she wanted a daddy to look after her," Mr Thatcher told the court.
"There was a conversation as to whether this involved him becoming involved with her mother. He told her 'Daddy loves his little girls not their mummies'."
The court heard Swift went on to send an image of his penis as well as explicit videos.
He made it clear he wanted to have sex and at one point he suggested a foursome with Emma, her 10-year-old sister and 14-year-old cousin.
Judge Simon Hirst also imposed a sexual harm prevention order and placed Swift on the sexual offences register for five years.
A man who groomed and arranged to meet what he believed to be a young school girl was trapped by internet vigilantes, a court has heard.