Teken023 Posted August 19, 2016 Share Posted August 19, 2016 (edited) Hey guys, not the best at scripting for there is still room for improvement but I need some help equipping an item when a Magic Effect is Active. Here's how it was set up; Scriptname "MyScript" extends ActiveMagicEffect Armor Property "MyItem" Auto Event OnEffectStart(Actor akTarget, Actor akCaster)player.equipitem(0600795C) ENDEVENT Event OnEffectFinish(Actor akTarget, Actor akCaster)player.removeitem(0600795C) ENDEVENT (RESULTS) MyScript.psc(11,26)- extraneous input 'C' expecting RPARENMyScript.psc(11,26)- extraneous input 'C' expecting RPAREN No output generated for SixPaths, compilation failed. Batch compile of 1 files finished. 0 succeeded, 1 failed- Can anyone explain; What am I doing wrong? Edited August 19, 2016 by Teken023 Link to comment Share on other sites More sharing options...
IsharaMeradin Posted August 19, 2016 Share Posted August 19, 2016 First: player is not defined. Either make a property for it or use Game.GetPlayer()Second: You cannot pass an ID number directly into the EquipItem and RemoveItem functions. You should use the MyItem property that you set up. However, it doesn't use quotes. Script should look something like: Scriptname MyScript extends ActiveMagicEffect Armor Property MyItem Auto Event OnEffectStart(Actor akTarget, Actor akCaster) Game.GetPlayer().equipitem(MyItem) ENDEVENT Event OnEffectFinish(Actor akTarget, Actor akCaster) Game.GetPlayer().removeitem(MyItem) ENDEVENT Link to comment Share on other sites More sharing options...
cdcooley Posted August 19, 2016 Share Posted August 19, 2016 And assuming this is a spell cast by or on the player use either akTarget or akCaster instead of Game.GetPlayer(). It will be faster to use the existing value than calling GetPlayer(). Link to comment Share on other sites More sharing options...
NexusComa Posted August 19, 2016 Share Posted August 19, 2016 Man, you gotta be quick around here when it comes to scripting help ... gj guys (as always) Link to comment Share on other sites More sharing options...
Recommended Posts