How do you subtract from a scene variable for every 10 of another variable?

Hello there, I am working on a game for a game jam. I am trying to reduce the player’s Fire Rate (how fast the player can shoot his/her weapon every second) by a small number every 10 kills they get.

So, basically if the player shoots 10 enemies then the fire rate should be subtracted by a small number. And if the player kills 10 more enemies then it should be reduced again.

Here is what I’ve tried:

(I can only put one image in a post since I am knew).

I could really use some help with this. I also need help with something else, but I’ll make a new topic for that later.

Are you displaying the player kills anywhere?

If not, I’d just do

The scene variable PlayerKills = 10 | Change the global variable PlayerFireRate subtract 0.01
Trigger once                        | Change the scene variable PlayerKills = 0

That way every 10 kills it reduces the firerate then resets.

1 Like

-Yes and thanks! I will certainly try this out in my game. Thanks again! I will let you know if it works.-

Oh my bad I read it too fast. Um I do have kills displayed.

You could add a different variable that increases at the same rate as player kills, but is set to zero after 10. So player kills could be something like 26, and that would mean that this new variable would be at 6, and reset after 10. I hope this helps.

1 Like

I ended up figuring out a work around, but I ended up doing something completely different.

Thanks for the help though!