Loop Sounds when within trigger

Hello.

I am fairly new to scripting within Unity and need help with making a sound loop whilst the player is walking within a trigger event. The script below make the audio play the clip once but for some reason doesn’t wish to loop the audio when I try adding in a timer event. Any help would be greatly appreciated. Many thanks

#pragma strict 

var splashClip:AudioClip;

var issplash = false;


function OnTriggerEnter(o:Collider)
{ 
issplash = false; 
if(issplash == false) 
{
playsplash(); 
}
}

function playsplash ()
{ 
audio.PlayOneShot(splashClip);
}

I would do something like this ( not tested )

function OnTriggerEnter(o:Collider)    
{ 
playsplash(); 
}
 
function OnTriggerExit(o:Collider)
{ 
StopSplash(); 
}
    
function PlaySplash ()
{ 
audio.loop = true;
audio.clip = splashClip;
audio.Play();
}
    
function StopSplash()
audio.Stop()
}