Scriptname AP_Health extends ActorActor vilmaGlobalVariable Property b_VilmaAutoHealth Auto ; boolean, If "1", auto-healSpell Property HealOther Auto Float Property SeekRange = 1000.0 AutoFloat Property PulseRate = 1.0 Auto ; How often do we shoot?Event OnInit() RegisterForSingleUpdate(PulseRate)EndEventEvent OnUpdate() bool auto_health= b_VilmaAutoHealth.Getvalue() if auto_health== 1 ; if global variable= 1 if vilma.GetDistance(Game.GetPlayer()) < SeekRange ; if close to the player float PercentHealth = Game.GetPlayer().GetActorValuePercentage("health") If (PercentHealth < 0.5) ;if (vilma.HasSpell(HealOther)) Debug.Notification("6") HealOther.Cast(vilma, Game.GetPlayer()) ; cast the spell ;endif endif endif RegisterForSingleUpdate(PulseRate) else UnregisterForUpdate(); endifendEvent
It works till the line "If (PercentHealth < 0.5)" that never achieves the condition.
Why?
Please help...