How can i display hp for player - fps game for javascript

when i try use this code JAVAScript unity 5.1 : healthtext.guiText.text =“health :” + health;

I’m getting this error but it working on unity 4.6.7
BCE0144: ‘UnityEngine.Component.guiText’ is obsolete. Property guiText has been deprecated. Use GetComponent() instead. (UnityUpgradable)

i tried like this but its not working. anyone get help?

healthtext.GetComponent(“health :”) + health;

hi…in unity4X above they changed scripting methods. use something like this.

healthtext.GetComponent<GUIText>().health+=health;

i don’t now your script so but use age of getcomponent is like that. once refer unity3d Docs about Getcomponent 1