jahnarae Posted July 2, 2012 Share Posted July 2, 2012 I am trying to make a skyrim version of the Boots of Springheel Jak and my papyrus skills are too novice for this task. The idea is for the boots to activate a perk when equipped and remove the perk when unequipped Here is my script that i have made based on web tutorials: Scriptname BootsofSpringheelJak extends ObjectReference {Scriptname BootsofSpringheelJak Event OnEquip(Actor akActor) If (akActor == Game.GetPlayer()) Game.GetPlayer()akActor.AddPerk(SpringheelJakPerk) endifendEvent Event OnUnequip(Actor akActor) If (akActor == Game.GetPlayer()) Game.GetPlayer()akActor.RemovePerk(SpringheelJakPerk) endifendEvent} Can somebody please correct the script so it adds the script when the item is equipped? Link to comment Share on other sites More sharing options...
gasti89 Posted July 2, 2012 Share Posted July 2, 2012 Scriptname BootsofSpringheelJak extends ObjectReference Event OnEquip(Actor akActor) If (akActor == Game.GetPlayer()) Game.GetPlayer().AddPerk(SpringheelJakPerk) endif endEvent Event OnUnequip(Actor akActor) If (akActor == Game.GetPlayer()) Game.GetPlayer().RemovePerk(SpringheelJakPerk) endif endEvent You don't need (and it's not possible) to script Game.GetPlayer()akActor. The script will fire when the player equips the boots and the perk will be assigned to the player without messing with the parameter. Also, i removed the { wich was invalidating the whole script (treating it as a comment) Link to comment Share on other sites More sharing options...
jahnarae Posted July 2, 2012 Author Share Posted July 2, 2012 Thanks. I was just doing what i could get from tutorials. I don't know how the { } got in the script. Must have added itself when i saved it. Link to comment Share on other sites More sharing options...
jahnarae Posted July 2, 2012 Author Share Posted July 2, 2012 This is my Scriptname BootsofSpringheelJak extends ObjectReference Event OnEquip(Actor akActor) If (akActor == Game.GetPlayer()) Game.GetPlayer().AddPerk(SpringheelJakPerk) endifendEvent Event OnUnequip(Actor akActor) If (akActor == Game.GetPlayer()) Game.GetPlayer().RemovePerk(SpringheelJakPerk) endifendEvent but the scripter says that variable SpringheelJakPerk is undefined how do i fix this? Link to comment Share on other sites More sharing options...
flobalob Posted July 2, 2012 Share Posted July 2, 2012 (edited) You need to define SpringheelJakPerk as the script does not know about perks (or anything else inside the CK for that matter) add these lines line after Scriptname BootsofSpringheelJak extends ObjectReference Perk Property SpringheelJakPerk auto {Perk to add/remove} and then set the property in the CK to whatever your perk is called, if ot's the same name the press autofill. Edited July 2, 2012 by flobalob Link to comment Share on other sites More sharing options...
steve40 Posted July 2, 2012 Share Posted July 2, 2012 (edited) Scriptname BootsofSpringheelJak extends ObjectReference { Jahnarae's Boots of Springheel Jak script. Adds perk "SpringheelJakPerk" when worn. Removes the perk when the boots are removed. } Perk Property SpringheelJakPerk auto {Assign the perk to this property using the Property button in CK} Event OnEquip(Actor akActor) {If the Player doesn't have the perk already, add it.} If (akActor == Game.GetPlayer()) If !AkActor.HasPerk(SpringheelJakPerk) akActor.AddPerk(SpringheelJakPerk) EndIf Endif EndEvent Event OnUnequip(Actor akActor) {If the Player has the perk then remove it.} If (akActor == Game.GetPlayer()) If AkActor.HasPerk(SpringheelJakPerk) akActor.RemovePerk(SpringheelJakPerk) EndIf Endif EndEvent Edited July 2, 2012 by steve40 Link to comment Share on other sites More sharing options...
Recommended Posts