Author Topic: SetLocalInt in OnDeath-script  (Read 314 times)

Legacy_Green_Dragon123

  • Newbie
  • *
  • Posts: 22
  • Karma: +0/-0
SetLocalInt in OnDeath-script
« on: March 11, 2011, 02:38:26 pm »


               I want to set a LocalInt in the same way as in conversations, but when a NPC dies instead. Is it possible? I haven´t been able to get it to work this far. Here´s what I´m using in case I´m doing something wrong.

Placed on the NPC´s OnDeath-event:

void main()
{
SetLocalInt(GetPCSpeaker(), "KILLEDHAROLD", 1);
}

And in the "Text appears when.."-script in a conversation with another NPC:

int StartingConditional()
{
int nKilledHarold = GetLocalInt(GetPCSpeaker(), "KILLEDHAROLD") == 1;
return nKilledHarold;
}

Thanks
               
               

               
            

Legacy_Thayan

  • Sr. Member
  • ****
  • Posts: 435
  • Karma: +0/-0
SetLocalInt in OnDeath-script
« Reply #1 on: March 11, 2011, 03:02:46 pm »


               Change GetPCSpeaker() in the OnDeath script to GetLastKiller()
               
               

               


                     Modifié par Thayan, 11 mars 2011 - 03:10 .
                     
                  


            

Legacy_Green_Dragon123

  • Newbie
  • *
  • Posts: 22
  • Karma: +0/-0
SetLocalInt in OnDeath-script
« Reply #2 on: March 11, 2011, 04:02:27 pm »


               Yes, I figured it out. Thanks for your reply.