Bleeding and Health Generation Skript

Hey guys :slight_smile: Im currently working on an FPS project and I created this fairly simple skript for Health generation, with the mechanic that the player can bleed out if he looses too much health. I get a compound error from unity saying this: 'js(43,1): BCE0044: expecting }, found ‘’.

I was wondering if you could help me out sorry if I made some simple mistakes im still learning :smiley:

#pragma strict
var MaxHealth = 80.0;

var health = MaxHealth;

//Time Till the Player starts to Regenerate after timer Trigger
var regenTime = 100.0;
//How fast the Player Regenerates
var regenSpeed = 1.0;

//Time till the player starts to Bleed after timer Trigger
var bleedTime = 10.0;
//How fast the Player Bleeds
var bleedSpeed = -1.0;

//Timer for Regeneration/Bleeding
private var timer = 0.0;

function Start () {

}

function Update () 
{
	if(health<=0)
		die();
		
	if(health<=21){
		if(timer<regenTime) {
			timer+=0.1;
		}else{
			health += regenSpeed/10;
		}
	
	if(health>=20){
		if(timer<bleedTime) {
			timer+=0.1;
		}else{
			health -= bleedSpeed/20;
		}
	}
}

On line 28 you open the if(health<=21){ bracket. You need to close this bracket on line 34