It would depend on the contract, but it's unlikely to be 3% of any income the company gets for any reason (eg interest on investments) and even less likely to be 3% of any money that shareholder get in exchange for their shares.
In most cases the company makes widget or product X, and the royalty is 3% of money for selling instances or copies or whatever of that X. It may even specifically exclude some such revenue: for example my book royalty contracts allowed me to get half the normal royalty, or even nothing at all, on certain high-volume, deep-discount sales (eg to Walmart). (This sort of thing is easily gamed if the remaining founders decide not to sell A any more, or to make A free and sell B instead. Royalty contracts need to be very carefully written.)
The way to compensate founders even after they leave is to give them shares. When the company is acquired, what is actually bought and sold is the shares. If you had been given 10% of the company, when it sold for 100 million, your shares would sell for 10 of that 100 million.
A contract like this is not something you should make up based on what you've seen on TV. A good lawyer at a time like this will earn their fee many times over.