Create a power up that last for a specific time

Hi! I making a videogame of shooting and when you hit a specific object you earn 10.
The thing I need is create a power up that when you take it, the quantity that you earn duplicates for 10 seconds.
I’m using yield waitforaseconds.

If this is the only multiplier you’ll be using, simply add a boolean to the class that handles the scored-pickups (not the powerup), then, set the powerup such that when you pick it up, it sets that boolean to true, and calls Invoke("DeactivatePowerup", powerupTime); where powerupTime is the time (in seconds) that you want the powerup to last for, and make a void method (or function, if you’re using javascript) in that same class, with the method signature void DeactivatePowerup() (or function DeactivatePowerup() : void, in javascript) in which you will set that boolean back to false.

If you are using other multipliers, multiply the incoming score by a float field stored in that monobehaviour, for the score multiplier, and simply add 2 to it (or multiply it by 2, depending on how you want it to affect it) and in the DeactivatePowerup() method, in stead of setting a boolean to false, you’ll be doing the opposite operation you applied to the multiplier when the powerup was activated.

I apologize if this seems at all convoluted, but given no source to work with, I can’t be of much more help than this.