I'm trying to display my ammo; not working

Hello, I’ve been using this script to shoot bullets out of my gun, and decided to add ammo and all that to the script. After i did that, I tried to display my ammo but it didn’t do anything to the text. Here is the script:

#pragma strict
import UnityEngine.UI;
  
var bullet : GameObject;
private var bulletsPerSecond = 20.0;
private var shooting = false;
private var Allammo : int = 320;
private var ammo : int = 35;
var sound: AudioClip; 
var Gun : GameObject;
var ammoDisplay : Text;

function Start()
{
	InvokeRepeating("Shoot", 0.0, 1.0 / bulletsPerSecond);
	ammoDisplay = GetComponent.<Text>(); //
}

function Shoot()
{
	if (!shooting) return;
	var go = Instantiate(bullet, transform.position, transform.rotation);
	go.rigidbody.AddRelativeForce(Vector3.forward * 1000.0);
	ammo = (ammo - 1);
	audio.PlayOneShot(sound);
}

function Update()
{
	shooting = false;
	if(Input.GetAxis("Fire1"))
	{
		shooting = true;
	}
	if (ammo == 0)
	{
		Allammo = (Allammo - 35);
	}
	ammoDisplay.text = ammo + "/" + Allammo.ToString();	
}

Thanks in advance

Line 16. ammoDisplay = GetComponent.(); // ERROR

C# :
 ammoDisplay = GetComponent.<Text>();

Js :
 
 ammoDisplay = GetComponent (Text);

So I finally got a script to work. I gave up on it a month ago, but decided to experiment. I got this as my final script and it works.

#pragma strict
  
var bullet : GameObject;
private var bulletsPerSecond = 20.0;
private var shooting = false;
private var Allammo : int = 320;
var ammo : int = 40;
var sound: AudioClip; 
var Gun : GameObject;
function Start()
{
	InvokeRepeating("Shoot", 0.0, 1.0 / bulletsPerSecond);
}
function Shoot()
{
	if (!shooting || ammo < 1) return;
	var go = Instantiate(bullet, transform.position, transform.rotation);
	go.rigidbody.AddRelativeForce(Vector3.forward * 1000.0);
	ammo = (ammo - 1);
	audio.PlayOneShot(sound);
}
function Update()
{
	if ((Allammo > 0) || ((ammo <= 40) && (ammo > 0) && (Allammo == 0)))
     {
         if (ammo > 0)
         {
             if (Input.GetButtonDown("Fire1"))
             {
                 shooting = true;
             }
             if (Input.GetButtonUp("Fire1"))
             {
                 shooting = false;
             }
         }
         else
         {
             shooting = false;
             Allammo = (Allammo - 40);
             ammo = 40;
         }
     }
     else shooting = false;    
}

I actually added this is two scripts, one to a text field on a canvas, and one to the gun. This is the script on the text. It differs from the one on the gun but are very alike.

#pragma strict

import UnityEngine.UI;
  
var bullet : GameObject;
private var bulletsPerSecond = 20.0;
private var shooting = false;
private var Allammo : int = 320;
var ammo : int = 40;
var sound: AudioClip; 
var Gun : GameObject;
function Start()
{  
	InvokeRepeating("Shoot", 0.0, 1.0 / bulletsPerSecond);
}
function Shoot()
{
	if (!shooting || ammo < 1) return;
	var go = Instantiate(bullet, transform.position, transform.rotation);
	go.rigidbody.AddRelativeForce(Vector3.forward * 1000.0);
	ammo = (ammo - 1);
	audio.PlayOneShot(sound);
}
function Update()
{
	if ((Allammo > 0) || ((ammo <= 40) && (ammo > 0) && (Allammo == 0)))
     {
         if (ammo > 0)
         {
             if (Input.GetButtonDown("Fire1"))
             {
                 shooting = true;
             }
             if (Input.GetButtonUp("Fire1"))
             {
                 shooting = false;
             }
         }
         else
         {
             shooting = false;
             Allammo = (Allammo - 40);
             ammo = 40;
         }
     }
     else shooting = false;    
}
function OnGUI () 
{
	GUI.Box (Rect (10,10,100,90), ammo + "/" + Allammo);
}