I need to detect player kills and check the killed actor's inventory. I have read quite complicated ways of doing this, and I wanted to know if there is an easy and reliable way.
At the moment I'm detecting the death of any NPC succesfully through an empty dialogue topic "Death" under the combat tab with empty conditions (runs on everybody). The script is set to run on "Result Script (Begin)" and fires every single time correctly. But this detects every death, it doesn't matter from what they died.
If I try something like
if iskiller Player ;Do something hereendifthe code in the "if" doesn't run. So my guess is that the iskiller only works correctly on the exact moment the NPC dies?
I also tried setting iskiller as a condition for the death topic to run, with Target Subject, Function Name iskiller, Function Info PlayerRef, Comp ==, and Value 1. The topic never fires...
Any easy way of doing this or a different method or command that can work in the dialogue other than iskiller?
Thanks in advance for any help...