It could be as simple as setting a boolean variable on the player.
- in the player:
- in the power up BP:
Much better ways methods exist, ofc. At some point consider looking into Actor Components
- think of them as of modular pieces of code you can add to / remove from actors on the fly. Each actor component is the ability and you spawn it on the player who now owns it. The ability has all the important script and can even handle input.
This way you do not need to burden the player with all the script upfront and only grant them abilities as the game progresses. It helps with organisation a lot - especially when you have 100 powers and do not want to have them all from the start.