Jump to content

Event OnHit not working


jangofett890

Recommended Posts

So I'm trying to make it so when you shoot at an object a few times it explodes and replaces itself with a different object, however the OnHit event never fires when I shoot at it.

My code

Scriptname MQNS_OnHit extends ObjectReference

ObjectReference Property AltMe Auto

Int Property TimesHit Auto

ObjectReference Property ToDisable Auto Const

event OnHit(ObjectReference akTarget, ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, \
  bool abSneakAttack, bool abBashAttack, bool abHitBlocked, string apMaterial)

TimesHit += 1

debug.notification("I'm hit! " + TimesHit + " Times!")

if TimesHit == 5

ToDisable.disable()
AltMe.Enable()
endif

EndEvent

The debug.notification never apears so I can only assume that the event is never firing.
I do have a mod enabled that may be causing it but I am not sure called Weapons of Fate http://www.nexusmods.com/fallout4/mods/12986/?
The only reason I think that might be causing it is because it messes with the bullet physics and such.

P.S I am unsure how to make an explosion effect (And sound?) appear and that information would also be helpful

Link to comment
Share on other sites

Thanks, I'll probably have to have it register because I'm doing it for a terminal, and turning it into a broken one, I'm looking at the wiki for destructible objects and it seems like it only uses models and activators, which a working terminal is obviously not just a model.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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