As i was modding my house, I came with an idea. I would like to put a script on a door in my house that activates the door only when hit with a specific spell (e.g. Firebolt) and not with an interaction button.
As i was modding my house, I came with an idea. I would like to put a script on a door in my house that activates the door only when hit with a specific spell (e.g. Firebolt) and not with an interaction button.
You'll have to figure out how to remove the prompt on the door.
Anyway this works well.
Scriptname SpellActivationScript extends ObjectReference Actor property PlayerRef autoSpell property ActivatorSpell autoAUTO STATE ClosedPosition ; assumed the door is closed by default(Open by default not checked on reference)Event OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, \ bool abBashAttack, bool abHitBlocked) if akSource == ActivatorSpell self.Activate(PlayerRef) endifEndEventEvent OnActivate(ObjectReference akActionRef) GoToState("Busy") self.SetOpen() GoToState("OpenPosition")EndEventENDSTATESTATE BusyEvent OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, \ bool abBashAttack, bool abHitBlocked);empty, event thrown out.EndEventEvent OnActivate(ObjectReference akActionRef);empty, event thrown out.EndEventENDSTATESTATE OpenPositionEvent OnHit(ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, \ bool abBashAttack, bool abHitBlocked) if akSource == ActivatorSpell self.Activate(PlayerRef) endifEndEventEvent OnActivate(ObjectReference akActionRef) GoToState("Busy") self.SetOpen(false) GoToState("ClosedPosition")EndEventENDSTATE