This one is not really a scam as such, but more the initiation of a possible scam. It actually happened to me the other day, which is why it's jogged my memory. I've also read reports on other websites (there is unfortunately a wealth of information about Barcelona scams and other such upsets) which confirms this as an easy tactic to employ.
I was waiting in a central location for a friend just the other day, and on the opposite side of the road a seedy looking character was walking in my direction. As he clocked me, he then walked into the middle of the road (without looking) and made a beeline directly for me. This obviously caught my attention, but for all I know he was looking at someone behind me , or taking the next street, just to my right. As he approached within earshot, he asked me for the time, in Spanish (he wasn't Spanish) "¿Que hora es?". Without evening thinking, I replied that I didn't know as I wasn't wearing a watch (and couldn't be arsed to look at my phone). So he veered back onto the opposite side of the road again and continued his rumble where he met up with another seedy looking character, and this second man obviously told the first guy that I'd followed his with my eyes, as he spun around to have another look. That's when I remembered that it's usually used as a trick to see if you're a local or a tourist - i.e. the majority of tourists might be able to understand the phrase but probably not answer the question, so would mumble something in their own language, thus giving away the fact that they're a tourist.
This all happened in a very busy location, in broad daylight and I have no idea what the guy/s would have tried if I'd replied in English that I didn't understand for example, but it just goes to show that some people will try anything at any time of the day!
What to do if this happens to you? My advice would be to look the other way, as if they aren't talking to you, and not bother replying. They will probably assume that you're a local and are wise to the scam-opener. There may be variations on this question, so keep your eyes and ears open. I must also point out that this is the first time it's happened to me in almost 10 years in Barcelona, so don't be alarmed!
For planning your trip against any possible mishaps, see this detailed Barcelona Guide and check out my other recent posts on Barcelona Scams:
The Restaurant Overcharge
The School Questionnaire
The Postcard cover up
The Reverse Parking Scam
3 Cups Scam
The Map Readers Scam
The Football Dance Scam
The Flat Tyre Scam
The Ketchup Squirt Scam
The Dancing Dollies Scam
For accommodation in the city, think about apartments for rent in Barcelona as a great alternative to hotel rooms.