Hello! I'm trying to make my timer to stop when the player wins. It's currently only counting, but when i die it stops..

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

public class Timer : MonoBehaviour{

float timer = 30.0f;
public Text text;
public GameObject GameOverText;
public bool enable;
void Update()
{

	if (timer > 0f) {

		timer -= Time.deltaTime;
		text.text = "" + Mathf.Round (timer).ToString();
	}
	else
	{
		GameOverText.gameObject.SetActive(true);
	}
}

}

Atm your script only counts down if the timer variable is above 0. so it will keep counting down until it hits 0. if you wish the timer to stop when the player wins then you need to make a call for that. perhaps a boolean?

so something along the lines:

     float timer = 30.0f;
     public Text text;
     public GameObject GameOverText;
     public bool enable;
     public bool playerHasWon = false;
     void Update()
     {
         if (timer > 0f && !playerhasWon) {
             timer -= Time.deltaTime;
             text.text = "" + Mathf.Round (timer).ToString();
         }
         else if (playerHasWon)
         {
             // do something about the winning condition
         }
        else {
           // do something about the losing condition.
        }
     }

Somewhere a condition must change the “playerHasWon” variable to “true” and then this should work.
without more information about your game and other scripts I hope this can guide you.