Hello, I have been having trouble with this for a very long time. It is kind of hard to explain what I am doing but you will understand if you look at the code:
Sorry that I am not explaining this well :/
code_language.skript:
on right click on player:
add 1 to {example.%player%}
command /example <playername>:
trigger:
give 2 snowballs to (the player that has the most examples on %player%