How can I detect when a progress bar hits 0

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Evilcobra2213

I am trying to play the death animation after the progress bar hits 0, with this code

if $Control/ProgressBar.value = 0:"Ded 1")

but it keeps giving me an error message

:bust_in_silhouette: Reply From: Adab

Writing only one equal sign means you are setting the value of your progress bar to 0. You have an error because you are not supposed to do an assignation in a condition. To do an equal comparison you need 2 equal signs instead of one:

if $Control/ProgressBar.value == 0:"Ded 1")