Jump to content

In Need of Script


MadTod

Recommended Posts

I'm trying to make an item that when in my inventory will a several spells and then when droped will remove said spells.

Basicly I need a script that adds and removes spells.

 

Any help would be very much appreciated, thanks.

Link to comment
Share on other sites

I would try something like this (didnt tested it, but should work). Attach it to your Object Form:

Scriptname YourScriptName extends ObjectReference
 
ObjectReference Property PlayerREF Auto
MiscObject Property YourObject Auto
Spell Property YourSpell Auto
 
Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer)
 
if akNewContainer == PlayerREF && PlayerREF.GetItemCount(YourObject) == 1
Game.GetPlayer().AddSpell(YourSpell, false)
elseif akOldContainer == PlayerREF && PlayerREF.GetItemCount(YourObject) == 0
Game.GetPlayer().RemoveSpell(YourSpell)
endIf

endEvent

 

Dont forget to define the properties xP

Edited by VectorPlexus
Link to comment
Share on other sites

The reason it failed was because I hadn't set the properties but now that I have it worked, so thanks for the help. Edited by TanisDuncan
Link to comment
Share on other sites

  • Recently Browsing   0 members

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