How to make player counter

there are simpler, but