Does this cat stress easily in a carrier, or in a new location, or was presented with some other situation or object that stressed him out? This too can cause this to happen.
Kaoepectate may be in order if he still has problems later tonight. There is no telling what he got into at your friend's place, but if he ate a new brand of food, that could do it.