How do I detect a max value in a status bar?

I need help because I need to detect the status bar at it’s max value.

I’m using an ‘if’ statement if that helps you figure it out.

here’s the code:

if (statusBar.value == statusBar.max) {
info.pauseCountup()
game.reset()
}