Jump to content

Referencing last actor hit


KazFoxsen

Recommended Posts

I'm working on a quest script which requires a reference to the last actor the player hit, but can't get it to work. It would be a lot easier if I could use "begin OnHit," but the script won't save unless it's put into an object script, which I can't use because it would be impractical to put a new bit of script on every NPC. I'm trying to work around this without luck. I've tried player.isincombat with no result, and GetCombatTarget doesn't work on the PC. Is there anything else I can do? This is what I've got so far:

 

ref LastHit

ref Vic1

 

begin GameMode

if getstage MandaCrippleQuest < 10

return

else set LastHit to player.getattacked

 

if (LastHit.GetDead == 1) || (LastHit.GetIsCreature == 1)

return

else

set Vic1 to LastHit ;if LastHit fits passes the victim requirements, the ref is stored as Vic1

ShowMessage MandaTestCombat ;just a test to see if it works, which it doesn't

endif

endif

 

;more stuff

end

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...