Having Trouble New to Scripting

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class NewBehaviourScript : MonoBehaviour {

public AudioClip SoundToPlay;
public float Volume;
AudioSource audio;
public bool alreadyPlayed = false;
// Use this for initialization
void Start()
{
audio = GetComponents

}
private void OnTriggerEnter()
{
if (!alreadyPlayed)
{
audio.PlayOneShot(SoundToPlay, Volume);
alreadyPlayed = true;
}
}
}

Hi,

whats the problem / error?

ps. you can insert code like this, so it looks nicer: Using code tags properly - Unity Engine - Unity Discussions

Yes, use code tags. Describe your problem

At a glance though, it may be your OnTriggerEnter isn’t correct.

There is also missing parentheses after the GetComponent call.