Aller au contenu

Photo

SetLocalInt in OnDeath-script


  • Veuillez vous connecter pour répondre
2 réponses à ce sujet

#1
Green_Dragon123

Green_Dragon123
  • Members
  • 11 messages
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

#2
Thayan

Thayan
  • Members
  • 244 messages
Change GetPCSpeaker() in the OnDeath script to GetLastKiller()

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


#3
Green_Dragon123

Green_Dragon123
  • Members
  • 11 messages
Yes, I figured it out. Thanks for your reply.