serya Posted May 13, 2020 Posted May 13, 2020 Hi, I´m still a noob at scripting, so maybe this is a stupid question. I wrote a script and attached it on the magiceffect of a Healspell (cast on the player). The script changes the strength of the spell depending on the lightlevel it is casted. This is working fine when casted on the player, but if i attach the script on a spell that is casted away (like a fireball or lightspell) nothing happens. The script is executed (the messageboxes are appearing), but the strength doesn´t change. Can somebody please help me to find the error? Here is the script: Spoiler Scriptname sunheal Extends ActiveMagicEffect import Debug import Math Spell Property healspell Auto Event OnEffectStart(Actor akTarget, Actor akCaster) MessageBox("Start") float lLevel = akCaster.GetLightLevel() MessageBox(lLevel) float magnitude = (lLevel / 5) * sqrt(lLevel) MessageBox(magnitude) healspell.SetNthEffectMagnitude(0, magnitude) EndEvent Thanks in advance
Recommended Posts
Archived
This topic is now archived and is closed to further replies.