Make a button only usable once.

I have a rule on a button to change attribute "game.score" to "game.score+random(50,100)" which is great for what i need. However, I only want the player to be able to use it once – then they are unable to use it to keep increasing their score.
I don't want to destroy the button because I want to keep it in the scene. I just want to make it so that if it is pushed a second time it wont add to the score again.
Thanks!
I don't want to destroy the button because I want to keep it in the scene. I just want to make it so that if it is pushed a second time it wont add to the score again.
Thanks!
Comments
self.ready
Check that attribute.
If touch is pressed and self.ready is true
Change game.score to game.score+bonus
Change self.ready to false.
Also, the actor's attribute has to be set to true by default.