Hello and welcome to the forums! Congratulations on your mod, I am sure it will be very nice! Now, about your script problem, you have to declare what is the "oRightHandWeapon"...use this one:
object oRightHandWeapon = GetItemInSlot(INVENTORY_SLOT_RIGHTWEAPON, oPartyMember);
That should solve your problem!
Anyway, welcome again and have a nice modding stay here at Holowan Labs!