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

**URL:** <https://forum.makecode.com/t/how-do-i-detect-a-max-value-in-a-status-bar/6854>\
**Category:** Help\
**Created:** [March 19, 2021, 1:54am UTC](https://forum.makecode.com/t/how-do-i-detect-a-max-value-in-a-status-bar/6854 "2021-03-19T01:54:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![brandodon](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/brandodon/32/3625_2.png) [@brandodon](https://forum.makecode.com/u/brandodon)\
**Post date:** [March 19, 2021, 1:54am UTC](https://forum.makecode.com/t/how-do-i-detect-a-max-value-in-a-status-bar/6854/1 "2021-03-19T01:54:32Z")

</div>

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()  
}
