Jump to content

[script help] Script to addspell on actors on equip


jiffyadvent

Recommended Posts

Greetings,

I've lately been trying to figure out how modify this script from the CK website tutorial to work on an NPC.

ScriptName tutGlovesofBlizzardScript extends ObjectReference  


Spell Property Blizzard auto


Event OnEquipped(Actor akActor)
       
                Game.GetPlayer().AddSpell(Blizzard)
        EndIf
EndEvent

 



I was thinking of using the console function "IsActor" if it is even possible to determine that the wielder of the weapon is an npc, but I dont quite know how to implement it. If anyone could help me out with this on how to make this work or write me the simple script I would really appreciate it..
I also need it to work on the player and any actor that equips the object..
Thanks




 

Link to comment
Share on other sites


ScriptName tutGlovesofBlizzardScript extends ObjectReference
;This script should be attached to the gloves


Spell Property Blizzard auto ;Make sure to fill this in the ck

Event OnEquipped(Actor akActor) ;This is "ON" the object being equipped
if (akActor == game.getplayer()) ; If the player actor is picking THIS object up..
Game.GetPlayer().AddSpell(Blizzard)
endif
EndEvent
Link to comment
Share on other sites

I misread your post. Script above only adds the spell if the player is the actor. This will add the spell to whoever picks it up

 

ScriptName tutGlovesofBlizzardScript extends ObjectReference  

Spell Property Blizzard auto

Event OnEquipped(Actor akActor)
     akActor.AddSpell(Blizzard)
EndEvent
Link to comment
Share on other sites

 

I misread your post. Script above only adds the spell if the player is the actor. This will add the spell to whoever picks it up

 

ScriptName tutGlovesofBlizzardScript extends ObjectReference  

Spell Property Blizzard auto

Event OnEquipped(Actor akActor)
     akActor.AddSpell(Blizzard)
EndEvent

Thanks I was confusing the "akActor" function for something else.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...