Press button to add 5sec to game timer

Hi and sorry in advance. I’m an absolute beginner. I followed tutorial on making buttons and another on making a game timer that ends in an end screeen. They work. now I would like to have that button press update the game timer, adding 5seconds. I would also like to add multiple buttons. At the moment if I add multiple buttons, only one works.


I think the “Update Time” should be looping, so it executes every second, updating the “Time Remaining” var.

To change the timer I guess you can get the remaining time, subtract the desired value (5s) and store as a variable, then you clear and invalidate de timer (You should store the Handle too, so you can manage it later), then set the timer again using the subtracted variable.

I can think in better ways to do it, If I could I’d be happy to stream via Discord.

1 Like

Hey thanks I’d really appreciate that. I’m supaflange#9653. I’ll go ahead and make those changes and look up storing the handle.

1 Like

i would do the code on your first print like this:

to add time to the clock with this method i did above you just need to change the time remaining variable to time remaining = time remaining + x

to do in with you button you just set time remaining to time remaining + 5 when the button in timer finished, before the delay.