# Every X Amount Of Points?

Get help using Construct 2

### » Sat May 03, 2014 9:19 pm

Im trying to make an enemy spawn every time the player adds so many points to the score variable.I just cant figure out how to make it happen over and over.
Could someone give me a hint on the expression that is needed to do so.
Thanks.

for example: Every Time the player adds 5 to the Score Variable i want something to happen.
GMO FOOD = DEATH
B
24
S
9
G
5
Posts: 567
Reputation: 6,428

### » Sat May 03, 2014 9:47 pm

how aobut having a separate variable that add+1 every time that the main varialbe adds+1
SO when the second variable gets to a number, you reset it back to 0 and then respawn enemies =)

like this

if player collects 1 coin
then*add+1 to "# of coins" variable
*add+1 to "# of coins to respawn enemy" variable

when "# of coins to respawn enemy" variable is = to 10 or >
then* set varaible "# of coins to respawn enemy" to 0
*respawn enemy at ???.X & ???.Y

does this work for you??
B
23
S
6
G
3
Posts: 316
Reputation: 3,461

### » Sat May 03, 2014 10:02 pm

@Lunatrap Thanks that actually worked fr me.
I didnt think of using a variable to track another variable then just have it reset once a condition is met.
Thanks for showing me this method and taking the time to write it out.
GMO FOOD = DEATH
B
24
S
9
G
5
Posts: 567
Reputation: 6,428

### » Sat May 03, 2014 10:21 pm

RookieDev wrote:@Lunatrap Thanks that actually worked fr me.
I didnt think of using a variable to track another variable then just have it reset once a condition is met.
Thanks for showing me this method and taking the time to write it out.

no problem, im glad i can help =)
B
23
S
6
G
3
Posts: 316
Reputation: 3,461