Error UnityEngine.Component.audio is obsolete.

I received a few errors when i am using this script trying to get audio to work, and i think it has to do with using the old version of unity before. Here they are

Assets/Scripts/Shooting.js(69,25): BCE0144: ‘UnityEngine.Component.audio’ is obsolete. Property audio has been deprecated. Use GetComponent() instead. (UnityUpgradable)

Assets/Scripts/Shooting.js(69,31): BCE0019: ‘playOneShot’ is not a member of ‘UnityEngine.Component’.

I dont know what is going on, but if there is another way to play the audio that would be great.

function Shoot(){
	while(true){
		if(shooting == true && weaponnum == 0 && rbullets1 > 0){
			rbullets1--;
			audio.playOneShot(aeksound, 1.0);
			Physics.Raycast(transform.position, transform.forward.hit);
			Debug.Log(hit.collider.tag);
				if(hit.collider.tag == "Player" || hit.collider.tag == "Vehicle"){
					Destroy(hit.transform.gameObject);
			}
		}
				else if(weaponnum == 0 && rbullets1 == 0){
					yield WaitForSeconds(2);
					if(rbullets >= 30);
						rbullets -= 30;
						rbullets1 += 30;
			}
			else if(rbullets < 30){
				rbullets1 += rbullets;
				rbullets = 0;
			}
		}
		if(shooting == true && weaponnum == 1 && pbullets1 > 0){
			pbullets1--;
			audio.playOneShot(walthersound, 1.0);
			Physics.Raycast(transform.position, transform.forward.hit);
			Debug.Log(hit.collider.tag);
				if(hit.collider.tag == "Player" || hit.collider.tag == "Vehicle"){
					Destroy(hit.transform.gameObject);
			}
		}
				else if(weaponnum == 1 && pbullets1 == 0){
					yield WaitForSeconds(2);
					if(pbullets >= 30);
						pbullets -= 30;
						pbullets1 += 30;
			}
			else if(pbullets < 30){
				pbullets1 += pbullets;
				pbullets = 0;
		}
}

That is just telling you to use GetCommponent()

To those looking for the answer. This worked just fine.

AudioSource.PlayClipAtPoint(walthersound, transform.position);

I dont know if it allows others to hear the audio though.

@Bunny83 also stated that i didn’t capitalize the P in Play. This function also works

GetComponent(AudioSource).PlayOneShot(aeksound, 1.0);