title: Select all joints of a character with Maya MEL
body: <p>I wrote an MEL script in Maya. So I want to select a joint, then run the MEL script and it selects that joint and all its children. I very new to MEL, So with running the code, it throws a bunch of errors. Can you help me reduce error or better to get rid of all of them?</p>
  <p>The Script:</p>
  <pre><code>string $joints[];
  string $current[] = 'ls -selection';
  
  proc selectJoints (){
      if ('searchJoints($joints)' == 0){
         $joints['size($joints)'] = $current[0];
         pickWalk -d down; 
         $current[0] = 'ls -sl';
         selectJoints();
      }
      else{
          pickWalk -d right;
          $current[0] = 'ls -sl';
          if('searchJoints($joints)' == 0){
              selectJoints();
          }
          else{
              pickWalk -d up;
              $current[0] = 'ls -sl';
              if($current[0] == $joints[0]){
                  selectJoints();
              }
          }
      }
      return;
  }
  
  select ($Joints);
  
  proc int searchJoints (string $jns[]){
      int $result = 0;
      for ($joint in $jns[]){
          if ($current[0] == $joint){
              return 1;
          }
      }
      return 0;
  }
  </code></pre>