Cannot convert 'String' to 'float'

So i want the float to always be taking the number from the UI text rather then a flat value. In my beginning code i have:

var player_hp : float = myText.text;  << Error here
var hp_value_player : String ="";
var player_damage_range : boolean = false;
var myText : Text;

Is there a way to make the float value always take whatever number is from my UI text no matter what?

Thanks

This

var player_hp : float = myText.text;

is invalid syntax because the field has not been properly initialized. What you want to do is this

import UnityEngine.UI;

var player_hp : float = 0;
var myText : Text;

function Start ()
{
    if (myText != null)
    {
        player_hp = float.Parse(myText.text);
    }
}