Regen fatigue when boolean becomes false (SOLVED)

BlightXP

  • Posts: 121
I want to make my player's fatigue regenerate when boolean becomes false.

I try using the do every x seconds under the 'false' block but it keeps on regenerating even if the boolean is set to true.

Anyone know a trick?

« Last Edit: April 24, 2013, 01:47:18 am by BlightXP »
abcdefghijklmnoyqrstuv-WXP&Z ;D

dtrungle

  • Posts: 1938
Have the boolean check inside the timer.

Ryusui

  • Posts: 827
Right. Once you set up a "do every X seconds" bracket, it keeps on going and going and going. And if you're running that kind of code in an "Always" event, hoo boy. That means you're creating another "do every X seconds" loop every frame.

What you want, as noted above, is to set up the "do every X seconds" bracket to fire once and only once when the condition is met, and then include a check for the stop condition inside the bracket.
In the event of a firestorm, the salad bar will remain open.

BlightXP

  • Posts: 121
Yey. Got it. That was too simple. xp
Thanks for the reply.
abcdefghijklmnoyqrstuv-WXP&Z ;D