Awarding XP to PC's for Associates Actions

Hi All, Can you not award the PC// GiveXPToCreature(oPC,50) if the henchman, ex. unlocks a door or placeable?
GiveXPToCreature works fine if the PC unlocks door or placeable. Here’s what I have on the on_unlock:

if (GetIsSkillSuccessful(oPC, SKILL_MOVE_SILENTLY,100) || (GetMaster(GetObjectByTag(“henchman”)) == GetLastUnlocked()))

FloatingTextStringOnCreature(“You have earned XP!”, oPC);
I would like to be able to award the PC player exp should the module player wish to multi class down the road and leave traps, locked chests, doors etc. to a rogue henchman. Is it doable? Thanks in advance.

Sure. For example,

  object oUnlocker = GetLastUnlocked();

  if (GetIsPC(oUnlocker))
      oPC = GetMaster(oUnlocker);

      if (GetIsPC(oPC))

It can be written more elegantly, of course.

1 Like

Thank you Proleric for your wisdom here! It works just great even with my modified version Thanks again!