Karel2015 Posted June 14, 2016 Posted June 14, 2016 - So I was wanting to do a script, That When you shoot an NPC with an object it will run a menu system with a few choices, So here is what I got so far: Compiles correctly, Seems to work correctly. Menu doesn't pop up when I shoot an NPC though, I know I have to be doing something wrong. Event OnHit(ObjectReference akTarget, ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked, string apMaterial) if (akAggressor == game.GetPlayer()) Bool abMenu = True Int aiButton = 0 Int iButton = MessageNameCommander.Show() If(iButton == 0) ; Cancel Return ElseIf(iButton == 1) ; Follow Me akTarget.AddKeyword(Follower) akTarget.AddKeyword(DontUseAmmo) RecruitLimit.Mod(1) ElseIf(iButton == 2) ; Guard Area akTarget.RemoveKeyword(Follower) akTarget.AddKeyword(DontUseAmmo) akTarget.AddKeyword(GuardArea) RecruitLimit.Mod(-1) ElseIf(iButton == 3) ; Stand Still akTarget.RemoveKeyword(Follower) akTarget.RemoveKeyword(GuardArea) akTarget.AddKeyword(StandStill) akTarget.AddKeyword(GuardArea) RecruitLimit.Mod(-1) ElseIf(iButton == 4) ; Send Home akTarget.RemoveKeyword(Follower) akTarget.RemoveKeyword(GuardArea) akTarget.RemoveKeyword(StandStill) akTarget.RemoveKeyword(DontUseAmmo) RecruitLimit.Mod(-1) EndIf EndIf EndEvent
Guest Posted June 14, 2016 Posted June 14, 2016 You have to register OnHit events: http://www.creationkit.com/fallout4/index.php?title=Differences_from_Skyrim_to_Fallout_4#OnHit_and_OnMagicEffectApply_require_registration Also, might be useful: http://www.creationkit.com/fallout4/index.php?title=RegisterForRemoteEvent_-_ScriptObject
Recommended Posts
Archived
This topic is now archived and is closed to further replies.