scripting error JS. How can i get my FPS player to have footsteps?

So i went around searching for a code and i came across this, however, its giving me a lot of errors i dont understand (i know nothing about scripting)
heres the code. Also can someone tell me if this is a correct code to sound footsteps accurately even when my player begins to run?
Thanks.

#pragma strict

var walk : AudioClip; 
var run : AudioClip;

var isWalking : boolean = false; 
var isRunning : boolean = false;

function Update() 
{ 
GetState(); 
PlayAudio(); 
}

function GetState() 
{ 
if ( Input.GetAxis( "Horizontal" ) || Input.GetAxis( "Vertical" ) ) 
{ if ( Input.GetKey( "left shift" ) || Input.GetKey( "right shift" ) ) 
{ // Running isWalking = false; isRunning = true; } else { // Walking isWalking = true; isRunning = false; } } else { // Stopped isWalking = false; isRunning = false; } }

function PlayAudio() 
{ 
 if ( isWalking ) 
{ 
 if ( audio.clip != walk ) 
{ 
 audio.Stop() ; 
 audio.clip = walk; 
}

   if ( !audio.isPlaying )
   {
     audio.Play();
   }
}
else if ( isRunning )
{
   if ( audio.clip != run )
   {
     audio.Stop();
     audio.clip = run;
   }

   if ( !audio.isPlaying )
   {
     audio.Play();
   }
}
else
{
   audio.Stop();
}
}

Well here’s the script with no errors or warnings. Didn’t have time to test actual functionality so just let me know what happens and I’ll try to get to more specifics if this doesn’t do the trick.

 #pragma strict
    
    var walk : AudioClip; 
    var run : AudioClip;
    var isWalking : boolean = false; 
    var isRunning : boolean = false;
    
    function Update() 
    { 
    	GetState(); 
    	PlayAudio(); 
    }
    
    function GetState() 
    { 
    	if(Input.GetAxis("Horizontal") || Input.GetAxis("Vertical")) 
    	{
    		if(Input.GetKey("left shift") || Input.GetKey("right shift")) 
    		{ 
    			isWalking = false; 
    			isRunning = true; 
    		} 
    		else 
    		{ 
    			isWalking = true; 
    			isRunning = false; 
    		}
    	}
    	else
    	{
    		isWalking = false;
    		isRunning = false;
    	}
    }
    
    function PlayAudio() 
    { 
    	if(isWalking) 
    	{ 
    		if (audio.clip != walk) 
    		{ 
    			audio.Stop() ; 
    			audio.clip = walk; 
    		}
    		if(!audio.isPlaying)
    		{
    			audio.Play();
    		}
    	}
    	else if (isRunning)
    	{
    		if(audio.clip != run)
    		{
    			audio.Stop();
    			audio.clip = run;
    		}
    		if(!audio.isPlaying)
    		{
    			audio.Play();
    		}
    	}
    	else
    	{
    		audio.Stop();
    	}
    }