for loop problem,problem with for loop

Hello, ihave no idea why this loop is performed only once. please help, many thanks

if (sc.wykorzystana == false)
    {
        secondcha.SetActive(true);
        for (float timer = 5; timer >= 0; timer -= Time.deltaTime)
        {                           
            if (sc.szansa ==1)
            {
                                                                              
                yield break;
            }
            Debug.Log(timer);
            yield return null;
           

        }

pleas help me, many thanks.

Looks like sc.szansa is 1, so it breaks the coroutine.
yield break doesnt break the inner loop. Breaks the coroutine.
Try this:

if (sc.wykorzystana == false)
{
    secondcha.SetActive(true);
    for (float timer = 5; timer >= 0; timer -= Time.deltaTime)
    {                           
          if (sc.szansa ==1)
          {
                 timer = 0;
          }else{
                 Debug.Log(timer);
                 yield return null;
          }
      }
}

Make sure this is in a IEnumerator method and that you are calling within StartCoroutine();