Yorkie77 Posted May 6, 2013 Share Posted May 6, 2013 Hi! I want to attach some script to a book so when the player picks it up, they immediately gain a spell rather than have to consume the book itself. I think what i've got is solid, but having an experienced pair of eyes look over it before I attempt to implement it would be nice :3 Scriptname bookspelltrial extends activemagiceffect Spell Property summonnpc auto book Property book1 auto Event OnContainerChanged(book1 newContainer, book1 oldContainer) if (newContainer == Game.GetPlayer()) Debug.MessageBox("You've gained a spell") Player.AddSpell(summonnpc) endif EndEvent As always, all help is greatly appreciated =3 Link to comment Share on other sites More sharing options...
GrimyBunyip Posted May 6, 2013 Share Posted May 6, 2013 (edited) Scriptname bookspelltrial extends activemagiceffect Spell Property summonnpc auto book Property book1 auto ACTOR PROPERTY PlayerRef AUTO Event OnContainerChanged(ObjectReference akNewContainer, ObjectReference akOldContainer) if (akNewContainer == PlayerRef) Debug.MessageBox("You've gained a spell") PlayerRef.AddSpell(summonnpc) endif EndEvent Edited May 6, 2013 by GrimyBunyip Link to comment Share on other sites More sharing options...
Recommended Posts