Object script effect needed for equip of weapon

Post » Mon Aug 08, 2011 11:10 am

I need a script that will put so that when i equip a weapon, or any other NPC equips this weapon (doesn't matter if it doesn't work on NPCs) the weapon gives them an ability to restore magicka 5 points. When they unequip the weapon the ability to restore magicka 5 points is removed. I've tried:

Scriptname IzCMeteoricClaymoreScript

Begin onequip ; (and Player)
addspell IzCWelkyndPower
Endif
End

Begin onunequip
removespell IzCWelkyndPower
Endif
End

It hasn't worked.
Help would be greatly appreciated, thankyou.
User avatar
Izzy Coleman
 
Posts: 3336
Joined: Tue Jun 20, 2006 3:34 am

Post » Mon Aug 08, 2011 1:14 pm

Why do you have an 'Endif' in there? I don't see an 'If' statement to go with it...

Also, its probably not working because you are adding the spell to the weapon, not the person equipping it.

You need to get the action ref.

ref myRefBegin onequip   set myRef to GetActionRef   myRef.addspell IzCWelkyndPowerEnd

User avatar
Nuno Castro
 
Posts: 3414
Joined: Sat Oct 13, 2007 1:40 am


Return to IV - Oblivion