function AISMN_RandomPause::OnEnter(%this,%obj)
{
   //SetStateVariable(%obj,0,RandomNumber(1,7));   //There's a bug here that needs 
                                                   //fixing. ClearVars is called in 
                                                   //code after OnEnter is resolved. 
                                                   //This greatly hinders the power 
                                                   //of this state machine scripting.
   return;
}

function AISMN_RandomPause::OnExit(%this,%obj)
{
   return;
}

function AISMN_RandomPause::Update(%this,%obj)
{
   if(GetStateVariable(%obj,0) == 0)
      SetStateVariable(%obj,0,RandomNumber(1,7));
   
   if(GetStateVariable(%obj,0) <= TimeInNode(%obj))
   {
      ReturnValue(%obj,0);
      return;
   }
   
   ReturnValue(%obj,-1);
   return;
}