Quibblonian101 Posted September 12, 2019 Share Posted September 12, 2019 (edited) I have a spell that uses something other than magicka to work. So I need to add a function that makes the spell fail If I don't have enough of the certain object. This is what I have so far and I'm using steel ingots as an example. I tried InterruptCast() but it did nothing. It removes the steel ingot and it sends the dubug notification, but it doesn't stop the cast when I have no steel. Scriptname Remove_SteelIngot_script extends ActiveMagicEffect Actor Property PlayerRef Auto MiscObject Property SteelRef Auto Event OnEffectStart(Actor akTarget, Actor akCaster) If (PlayerRef == akCaster) If akCaster.GetItemCount(SteelRef) < 1 akCaster.InterruptCast() Debug.Notification("You have no steel!") ElseIf akCaster.GetItemCount(SteelRef) >= 1 akCaster.RemoveItem(SteelRef, 1) EndIf EndIf EndEvent Edited September 12, 2019 by Quibblonian101 Link to comment Share on other sites More sharing options...
Evangela Posted September 12, 2019 Share Posted September 12, 2019 Try a condensed version, the player is always the caster, so you can skip that check: Int SteelCount = akCaster.GetItemCount(SteelRef) if SteelCount == 0 akCaster.InterruptCast() else akCaster.RemoveItem(SteelRef, 1) endif Link to comment Share on other sites More sharing options...
Quibblonian101 Posted September 12, 2019 Author Share Posted September 12, 2019 Okay thanks, I'll see if it works. Link to comment Share on other sites More sharing options...
Recommended Posts