The Riot Act was actually an act of British Parliament introduced in 1714. This was a time of unrest when George I had just become King. He was extremely unpopular and the commoners were rioting. Parliament introduced the Riot Act so that any official could read the Riot Act to any group of 12 people. Upon the completion of the reading of the act, the group had 20 minutes to disband. If they didn't disband, force could be used to do so. This is how the act read:
"Our Sovereign Lord the King chargeth and commandeth all persons, being assembled, immediately to disperse themselves, and peaceably to depart to their habitations, or to their lawful business, upon the pains contained in the act made in the first year of King George, for preventing tumults and riotous assemblies. God Save the King."
Hence, the phrase "reading you the riot act" was formed. The act was repealed in 1973, but the phrase is still used today for anyone that wants you to stop gathering. So if anyone is really pissed off at you and they reached to you (as if reading the Riot Act), this means you and your 11 friends have 20 minutes to disband.