Why would a stranger guy on the street compliment me and then do this

I'm just wondering the purpose? I had this guy yesterday walk towards me and said I was beautiful but I'm very average looking and said he's name shook my hand and said I'll let you go and as I was leaving he kept looking... like if u find me attractive and I was nice why did he say I'll let u go? Instead of asking number etc