while stops script after looping 1 time

Hi guys, it seems that my script get stopped, when the while loop dont loop and instead just runs one time.
Here’s my code:

int count = 0;
int repetitions = Random.Range(1,4);
while(!(count == repetitions)) 
	{
		yield return new WaitForSeconds (0.5f);
		count += 1 ;
	}

If the repetitions int gets 1 the script breaks after the loop, unity still works!
Please help me need your support :smiley:
THX

just use a for loop instead

Update:

using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class FillBar : MonoBehaviour
{
    public Image FillBarImage;

    private int foundResults = 0;
    private int count = 0;
    private float fillamount = 0.0f;

    void OnEnable()
    {
        FillBarImage.fillAmount = 0;
        fillamount = 0;
        count = 0;
        foundResults = Random.Range(1, 4);
        float floattrans = foundResults;
        float fillPart = 1 / floattrans;
        StartCoroutine(WaterF(fillPart));
    }
    IEnumerator WaterF(float partValue)
    {
        while (!(count == foundResults))
        {
            count += 1;
            fillamount += partValue;
            yield return new WaitForSeconds(0.5f);
        }
        CTRL.i_water += 1; //i_water = inventory Water
        CTRL.ChangeLevelName = "menu"; // transform to enable
        CTRL.ChangeLevel = true;  // start process changing (transforms(based on ui))
    }

i tried to cut the useless things out thats my script its only accesing intern variables its also cant
just runs a random function