How do i minus the time when my character dies?

You don’t modify the timer. It like a stop watch - it can only be started, reset, paused and unpaused. You can’t change the stopwatch time though.

Instead you change the value you check the timer against. You’ve hardcoded the 90 seconds. Use a variable for this instead:


Also, reset the timer when you pause it, otherwise it’ll remain over 90 and the timer check events will continually execute.

And get rid of that trigger once - you’ve only had to put it in there because the timer wasn’t reset when it was paused.

where can i find the scene variable action

Click on “Add action” in the event. Then search for scene variable:

image

it doesn’t work, look

I also remove the trigger once but not work too :((

What do you mean “It doesn’t work”? What is it doing? Please be a lot more descriptive.

as you can see in here, i copied what u did then when i tried it

this happens

i killed myself and it doesn’t subtract

1 Like

i am currently doing this for our project, kindly teach me huhu thx, i don’t know why it is not working

Remember the Timers doesn’t change, it’s the threshold (in this case Time_limit) that changes.

The problem is with the formula you are using to work out the text. You’re taking 90 off the elapsed timer time. The timer starts at 0 and increases, so the equation elapsed_time - 90 will start at -90 and work up to 0. This is also why you use abs, to remove the minus sign.

The correct equation you should be using is

round(Time_limit - TimerElapsedTime("times"))

That will start the text at 90 and count down to 0. When you decrease Time_limit by 20, it’ll be reflected in the text.

ohhh, what action will i use, change txt?

The action you have should be fine. Although you could probably do away with the function to convert to HHMMSS if all you are showing is the countdown, and not minutes and seconds.

Wrap it in a ToString(…).

And isn’t the timer name “times”, all lowercase?

i’ve changed it, anyways, look

I don’t know what character you added there or how. All I can suggest is either

  1. you place the cursor before the minus sign, and press delete until the cursor is before the word TimerElapsedTime, and then add the minus sign.
  2. delete the event and recreate it, typing everything in again.