Help with logic - I'm having a brain fart

I have code that increments a value (int += 1) on a button press. Separately, I want to decrement that same value (int -= 1) if the player does not press the button within a set time period. (lets say 2.0s).

I know we could use Button.InteractedWithEvent.Await() here but I’m coming up blank.

Thanks!

This should do the trick:

race:
    block:
        Button.InteractedWithEvent.Await()
        set Value += 1
    block:
        Sleep(2.0)
        set Value -= 1
2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.