Jump to content

OnHit script Problems


daisy8

Recommended Posts

Hi there guys.

 

I am attempting to use the OnHit event and to display some information about the hit on the screen. Really only doing this as an exercise to learn Papyrus !!

 

Here is my script -

 

ScriptName ADZChangeAttackToAggressorScript extends Actor
{Script that changes a NPCs focus of attack from the player to another NPC}

ObjectReference Property Chiska Auto

Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked)

if akAggressor == Chiska
Debug.Notification("Bandit hit by Chiska with" + akSource)
Game.GetPlayer().AddToFaction(BanditFriendFaction)

elseif akAggressor == Game.GetPlayer()
Debug.Notification("Bandit hit by ME with my" + akSource)
EndIf
EndEvent

 

Chiska is another NPC.

 

Any reason why I shouldn't be seeing a message saying either "Bandit hit by Chiska with Fireball" or "Bandit hit by ME with my Sword" ? Dependant on whether the NPC was hit by me or Chiska ??

 

In game the messages are "Bandit hit by Chiska with [form" or "Bandit hit by ME with my [weapon"

 

Anyhelp ?

Link to comment
Share on other sites

  • Recently Browsing   0 members

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