how to make the Every 100 points something happens?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By AntBagel

So, i have a clicker game and i want to make it so that every 100 clicks you get +1 point per click.

func Score():
if Score < 100: 
	Score += 1
if Score >= 100 && Score <= 200:
	Score += 2

So i want to do this, but automatic so its like an endless game. How do i do it?

The below should work for you

var inc_score = 1 


func score():

If score % 100 == 0:
   inc_score += 1
   score += inc_score

Gluon | 2022-03-09 15:23

:bust_in_silhouette: Reply From: lettucing

you could try

func Score():
    if score % 100 == 0:  # if the score / 100 has 0 remainder
        score += score/100 # add the score / 100

its not working,its just not giving any points now. but thanks anyway

AntBagel | 2022-03-09 15:19

Nvm im stupid i deleted the script which shows the score lol
Thank you!

AntBagel | 2022-03-10 13:28

:bust_in_silhouette: Reply From: jgodfrey

Based on your example, I think you just want something like this:

func Score():
	score += (score / 100) + 1

Scores of:

0 - 99 will add 1
100 - 199 will add 2
200 - 299 will add 3
...

… to the score variable

Thank you very much!

AntBagel | 2022-03-10 13:29