Counting # of clicks

how would i write a script that counts the number of clicks on a certain button?

this is what i want to do:
“if you press this button 10 times, a message will appear”.

i plan to use a dynamic text box to load a certain message after someone clicks a button 10 times …