Sturmgewehrrrrrrrrrrr Posted January 29, 2022 Share Posted January 29, 2022 Help! I attach this script to my test sword, and it doesn't work I want that when I hit someone with a sword, it gives me my bread, which I made Scriptname takeBreadFREE extends ObjectReference potion property Bread auto Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, \ bool abBashAttack, bool abHitBlocked) If akAggressor == Game.Getplayer() Game.GetPlayer().AddItem(Bread, 1, true) EndIf EndEvent Link to comment Share on other sites More sharing options...
Sturmgewehrrrrrrrrrrr Posted January 29, 2022 Author Share Posted January 29, 2022 My question is to what i need to attach this script to make it work Link to comment Share on other sites More sharing options...
IsharaMeradin Posted January 29, 2022 Share Posted January 29, 2022 OnHit runs when an object gets hit by something. If you want it to run whenever your sword hits an opponent then the opponent needs to be running the script. Which in turn means that you will need a "cloaking ability" which in essence reaches out and locates nearby objects that meet your requirements and then attaches the script to them by placing said objects into quest aliases. Why the convoluted hard to explain round about method? Applying a script to each potential opponent directly will be tedious, time consuming and highly prone to conflict with any mod that affects the same objects in a direct manner. See Dynamically Attaching Scripts for more info. Link to comment Share on other sites More sharing options...
Recommended Posts