Change UI GUI Image Sprite at runtime .. Unity 5 .. js (147065)

Hi,

I’m trying to swap a image sprite of a UI GUI but it’s not swapping, what is wrong with my code ? .. I’m getting no errors.

Thanks.

 #pragma strict
 
 import UnityEngine.UI;
 
private var GUIweaponSprite : Sprite;
     
function Start ()
{
      GUIweaponSprite = GameObject.Find("Info Disk Weapon").GetComponent.<Image>().sprite;
}
     
function OnGUI ()
{
       GUIweaponSprite = _weapons[2];
 }

private var GUIweaponImage : Image;

 function Start ()
 {
       GUIweaponImage = GameObject.Find("Info Disk Weapon").GetComponent.<Image>();
 }
      
 function OnGUI ()
 {
        GUIweaponImage.sprite = _weapons[2];
  }