This is the script I've been trying to get to work:
Scriptname Cerebral_TrainingDummy extends ObjectReference {Allows training dummies to be used for leveling. Usefulness declines as you grow stronger in your skill.};====== Ranged Weapons ===================Keyword Property WeapTypeBow AutoKeyword Property VendorItemArrow AutoKeyword Property WeapTypeBoundArrow Auto;====== One-Handed Weapons================Keyword Property WeapTypeMace AutoKeyword Property WeapTypeWarAxe AutoKeyword Property WeapTypeDagger AutoKeyword Property WeapTypeSword Auto;====== Two-Handed Weapons================Keyword Property WeapTypeGreatsword AutoKeyword Property WeapTypeBattleaxe AutoKeyword Property WeapTypeWarhammer Auto;====== Destruction Magic=================Keyword Property MagicDamageFire AutoKeyword Property MagicDamageFrost AutoKeyword Property MagicDamageShock Auto;====== Other Properties==================Actor Property Player AutoEvent OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked) ;Debug.Notification("Hit detected.") if (akAggressor == Game.GetPlayer()) Debug.Notification("The player hit me!") if akSource.HasKeyword(WeapTypeSword) Debug.Notification("Hit with a one-handed weapon!") Game.AdvanceSkill("OneHanded", 10.0) endif endifEndEvent
The code works great at detecting when the player hits the activator, but it fails to recognize when I'm hitting it with an iron sword.