no appropriate version for argument list

i can’t get my GUI text appear in the center it says: “no appropriate version for argument list”

here is my script-

#pragma strict

var Health = 100;
var isDead: boolean = false;
 
function Update () {
    if(Health <= 0) {
        Dead();
    }
}
 
function ApplyDammage (TheDammage : int) {
    Health -= TheDammage;
}
 
function Dead() {
    isDead = true;
}

function OnGUI(){
   if(isDead){
        GUILayout.Label(Rect (0, 0, 100, 50), "You Lost");
   }
}

Hello,

You are using a GUILayout, it doesn’t take the Rect argument.

you should use this:

GUILayout.Label("You Lost");

or this:

GUI.Label(new Rect (0, 0, 100, 50), "You Lost");

Edit: and to be centered it should be this:

 GUI.Label(new Rect (Screen.width/2 -50, Screen.height/2-25, 100, 50), "You Lost");