There is a set of variables that indicates the node names for each body part:
$rhand0 = rhand
$rhand1 = rhook
That for loop will look through $rhand[X] and if its a valid node, it'll hide it. Normally it'd be an effective way of accomplishing this task, except he's pinched the code from somewhere and done a Frankenstein job on it.