The spell should only performed once. It is needed to fix some behavior of my mod Realistic Body System.
here is the papyrus script i made, it starts if a cell is entered:
Scriptname RBSCorrectNPCs extends activemagiceffectfunction resetWeight(actor target)if (target.IsDead()== false) Utility.SetINIBool("bUseFaceGenPreprocessedHeads:General", false) target.SetDontMove(true) target.QueueNiNodeUpdate() target.Resurrect() target.SetAllowFlying(false) target.SetDontMove(false) Utility.SetINIBool("bUseFaceGenPreprocessedHeads:General", true)endifendFunctionEvent OnEffectStart(Actor akTarget, Actor akCaster)float random = Utility.RandomFloat(0.5, 4.0)Utility.Wait(random)resetWeight(akTarget)EndEvent
It works, but if a reenter a cell it is performed again. An even better way would be that it will be perfomed without beeing in cell, but i guess that is not possible, right?
So i need to be sure that the script is only performed once per npc.