Option to toggle SSAO in game? [Solved]

Hello, I want to have an option on my pause menu and main menu to turn off some of the image effects in game. How would I go about doing this? The main one I want to have an option for is SSAO, so I’d like to start with that.

Cache the component on the camera then enable or disable it.

#pragma strict

var cam : Camera;
private var ssao : SSAOEffect;
private var toggleSsao : boolean = true;

function Start () {
    if (cam==null) cam = Camera.main;
	ssao = cam.GetComponent(SSAOEffect);

function OnGUI () {
	toggleSsao = GUI.Toggle(Rect(10, 10, 100, 30), toggleSsao, "SSAO");
	if (GUI.Button(Rect(10,70,50,30),"Save")) {
		ssao.enabled = toggleSsao;