Jump to content

Book script to add magic effect on read


Biovex

Recommended Posts

Im trying to write a book script that, when the book is read, casts a spell, but only if the player has a certain perk.

The spell is supposed to add a constant magic effect to the player, but when I read the book nothing happens, no effect or anything. I've gone through and double checked the spell and magic effect a few times the only thing I can think of not working correctly is the script

 

So far this is what I have

 

Scriptname BioTSTest extends MagicEffect 

 

Perk Property HPerk Auto

Spell Property CastSpell Auto

 

Event OnRead()

       If    !Game.GetPlayer ().HasPerk(HPerk)

              CastSpell.Cast(Game.GetPlayer(), Game.GetPlayer())

       EndIf

EndEvent

 

Any help would be greatly appreciated

Link to comment

In accordance to what you said I changed the script to

 

Scriptname BioTSTest extends MagicEffect 

 

Perk Property HPerk Auto

Spell Property CastSpell Auto

 

Event OnRead()

       If    !Game.GetPlayer ().HasPerk(HPerk)

 Game.Getplayer().AddSpell(CastSpell)

       EndIf

EndEvent

 

And still nothing

Link to comment
4 hours ago, Biovex said:

Scriptname BioTSTest extends MagicEffect 

This part also incorrect.

If you attach this script to a book, it should be like

Scriptname BioTSTest extends ObjectReference

And !Game.GetPlayer ().HasPerk(HPerk) also incorrect.

Remove "!" from this string (because it will fire only if player don't have this perk).

Link to comment

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use