Jump to content

Papyrus Script "Equip item extends ActiveMagicEffect"


Teken023

Recommended Posts

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 RPAREN
MyScript.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 by Teken023
Link to comment
Share on other sites

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

  • Recently Browsing   0 members

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