Decrease Health every 5 mins or Time script?

Hello there, i am new to unity. Just want to ask a question, are there any simple script for decreasing Health every 5 minutes? Even is there a time script where it shows time in the upper screen? i’m sorry about this im still learnning and if you could, Please tell me how :slight_smile:

Many thanks!

this one should work straight up

function OnGUI () {
  GUI.Box( Rect(10, 10, 300, 300)," ");
    GUI.Label (Rect (10, 10, 300, 300), " hi dude +0123

time ="+Time.time );
}

//to decrease health every 5: have to add the variables if you can! :

var delay = 500;//ms?

function Start(){
delayedtime = Time.time + delay;
}
function Update(){

if (Time.time > delayedtime){health = health -1; delayedtime = Time.time + delay}
}

//you have to declare the variables at the top of the script, its only a few lines to figure out! learn that you learn alot!

Decrease health every 5 minutes:

var health = 100;
var healthReductionDelay = 300;  // seconds

function Start () {
    InvokeRepeating ("DecreaseHealth", healthReductionDelay, healthReductionDelay);
}

function DecreaseHealth () {
    health--;
}