Biovex Posted December 6, 2017 Share Posted December 6, 2017 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
Azazellz Posted December 6, 2017 Share Posted December 6, 2017 If spell "constant" type - you should use "AddSpell". Link to comment
Biovex Posted December 6, 2017 Author Share Posted December 6, 2017 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
Azazellz Posted December 6, 2017 Share Posted December 6, 2017 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
Biovex Posted December 6, 2017 Author Share Posted December 6, 2017 I made the changes and it worked! Thanks for the help dude, I searched for a way to fix it for 2 days and couldn't find one that worked. Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.