Javascript Timer Is Not Working

The Problem is that the timer Dont Stop where it should stop and the thing is that sometimes it stop correctly and sometimes it dont here is the code:
var timer:float; var Maze:GameObject; var ball:GameObject; var ball1:GameObject; var Emoji:GameObject; var Text:UnityEngine.UI.Text; var text1:GameObject; var text2:GameObject;
function Update () {
timer-=Time.deltaTime;
timer.ToString();
Text.text=timer.ToString();

if(timer<=0.5){

     Maze.SetActive(false);
     ball.SetActive(false);
     ball1.SetActive(false);
     text2.SetActive(false);

     Emoji.SetActive(true);
     text1.SetActive(true);

}

Help Me Please with this

You have

timer-=Time.deltaTime
in Update() with no condition, sure it never stops.
Add an 'if", like a bool

if(!emojiActive)
{
timer-=Time.deltaTime
}

here are two working timer examples:

var timer:float;
var timer2:float;
var b:boolean;
var counter:int;
function Update () { 

// this timer happens only once
if(!b){ 
timer+=Time.deltaTime; 
if(timer>=10){b=true;
print("<color=green>first counter triggered</color>");}}


//this timer repeats forever
timer2+=Time.deltaTime; 
if(timer2>=5){timer2=0;
counter+=5;
print(counter+" seconds");}


}